Update to Chromium revision 248478.
- Add new CefSettings.windowless_rendering_enabled value that must be enabled when using windowless (off-screen) rendering. - Improve naming and documentation for CefWindowInfo members. - CefBeginTracing now completes asynchronously. - Rename CefEndTracingAsync to CefEndTracing. - Rename CefCompletionHandler to CefCompletionCallback. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1592 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
76f6ca0763
commit
8078afe7bf
|
@ -17,5 +17,5 @@
|
|||
|
||||
{
|
||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||
'chromium_revision': '242756',
|
||||
'chromium_revision': '248478',
|
||||
}
|
||||
|
|
6
cef.gyp
6
cef.gyp
|
@ -868,7 +868,6 @@
|
|||
'<(DEPTH)/ui/gl/gl.gyp:gl',
|
||||
'<(DEPTH)/ui/ui.gyp:ui',
|
||||
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
|
||||
'<(DEPTH)/webkit/glue/webkit_glue.gyp:glue',
|
||||
'<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser',
|
||||
'<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common',
|
||||
# Necessary to generate the grit include files.
|
||||
|
@ -1037,6 +1036,8 @@
|
|||
'libcef/common/value_base.h',
|
||||
'libcef/common/values_impl.cc',
|
||||
'libcef/common/values_impl.h',
|
||||
'libcef/common/upload_data.cc',
|
||||
'libcef/common/upload_data.h',
|
||||
'libcef/renderer/browser_impl.cc',
|
||||
'libcef/renderer/browser_impl.h',
|
||||
'libcef/renderer/content_renderer_client.cc',
|
||||
|
@ -1279,6 +1280,7 @@
|
|||
'mac_bundle_resources': [
|
||||
'<(PRODUCT_DIR)/cef.pak',
|
||||
'<(PRODUCT_DIR)/devtools_resources.pak',
|
||||
'<(PRODUCT_DIR)/icudtl.dat',
|
||||
'libcef/resources/framework-Info.plist',
|
||||
],
|
||||
'mac_bundle_resources!': [
|
||||
|
@ -1635,7 +1637,7 @@
|
|||
'<@(includes_win)',
|
||||
# TODO(cef): Remove ui_unscaled_resources.rc once custom cursor
|
||||
# resources can be loaded via ResourceBundle. See crbug.com/147663.
|
||||
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.rc',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
|
||||
'libcef_dll/libcef_dll.rc',
|
||||
],
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
..\third_party\python_26\python.exe tools\gclient_hook.py
|
||||
python.bat tools\gclient_hook.py
|
||||
|
|
|
@ -138,8 +138,8 @@
|
|||
'libcef_dll/ctocpp/client_ctocpp.h',
|
||||
'libcef_dll/cpptoc/command_line_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/command_line_cpptoc.h',
|
||||
'libcef_dll/ctocpp/completion_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/completion_handler_ctocpp.h',
|
||||
'libcef_dll/ctocpp/completion_callback_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/completion_callback_ctocpp.h',
|
||||
'libcef_dll/ctocpp/context_menu_handler_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/context_menu_handler_ctocpp.h',
|
||||
'libcef_dll/cpptoc/context_menu_params_cpptoc.cc',
|
||||
|
@ -300,8 +300,8 @@
|
|||
'libcef_dll/cpptoc/client_cpptoc.h',
|
||||
'libcef_dll/ctocpp/command_line_ctocpp.cc',
|
||||
'libcef_dll/ctocpp/command_line_ctocpp.h',
|
||||
'libcef_dll/cpptoc/completion_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/completion_handler_cpptoc.h',
|
||||
'libcef_dll/cpptoc/completion_callback_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/completion_callback_cpptoc.h',
|
||||
'libcef_dll/cpptoc/context_menu_handler_cpptoc.cc',
|
||||
'libcef_dll/cpptoc/context_menu_handler_cpptoc.h',
|
||||
'libcef_dll/ctocpp/context_menu_params_ctocpp.cc',
|
||||
|
|
|
@ -69,7 +69,7 @@ typedef struct _cef_callback_t {
|
|||
///
|
||||
// Generic callback structure used for asynchronous completion.
|
||||
///
|
||||
typedef struct _cef_completion_handler_t {
|
||||
typedef struct _cef_completion_callback_t {
|
||||
///
|
||||
// Base structure.
|
||||
///
|
||||
|
@ -78,8 +78,8 @@ typedef struct _cef_completion_handler_t {
|
|||
///
|
||||
// Method that will be called once the task is complete.
|
||||
///
|
||||
void (CEF_CALLBACK *on_complete)(struct _cef_completion_handler_t* self);
|
||||
} cef_completion_handler_t;
|
||||
void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self);
|
||||
} cef_completion_callback_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -120,11 +120,11 @@ typedef struct _cef_cookie_manager_t {
|
|||
|
||||
///
|
||||
// Flush the backing store (if any) to disk and execute the specified
|
||||
// |handler| on the IO thread when done. Returns false (0) if cookies cannot
|
||||
// |callback| on the IO thread when done. Returns false (0) if cookies cannot
|
||||
// be accessed.
|
||||
///
|
||||
int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self,
|
||||
struct _cef_completion_handler_t* handler);
|
||||
struct _cef_completion_callback_t* callback);
|
||||
} cef_cookie_manager_t;
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_callback_capi.h"
|
||||
|
||||
|
||||
///
|
||||
|
@ -68,9 +69,9 @@ typedef struct _cef_end_tracing_callback_t {
|
|||
|
||||
|
||||
///
|
||||
// Start tracing events on all processes. Tracing begins immediately locally,
|
||||
// and asynchronously on child processes as soon as they receive the
|
||||
// BeginTracing request.
|
||||
// Start tracing events on all processes. Tracing is initialized asynchronously
|
||||
// and |callback| will be executed on the UI thread after initialization is
|
||||
// complete.
|
||||
//
|
||||
// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is
|
||||
// pending, CefBeginTracing will fail and return false (0).
|
||||
|
@ -84,7 +85,8 @@ typedef struct _cef_end_tracing_callback_t {
|
|||
//
|
||||
// This function must be called on the browser process UI thread.
|
||||
///
|
||||
CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories);
|
||||
CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Stop tracing events on all processes.
|
||||
|
@ -99,7 +101,7 @@ CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories);
|
|||
//
|
||||
// This function must be called on the browser process UI thread.
|
||||
///
|
||||
CEF_EXPORT int cef_end_tracing_async(const cef_string_t* tracing_file,
|
||||
CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file,
|
||||
cef_end_tracing_callback_t* callback);
|
||||
|
||||
///
|
||||
|
|
|
@ -63,7 +63,7 @@ class CefCallback : public virtual CefBase {
|
|||
// Generic callback interface used for asynchronous completion.
|
||||
///
|
||||
/*--cef(source=client)--*/
|
||||
class CefCompletionHandler : public virtual CefBase {
|
||||
class CefCompletionCallback : public virtual CefBase {
|
||||
public:
|
||||
///
|
||||
// Method that will be called once the task is complete.
|
||||
|
|
|
@ -136,11 +136,11 @@ class CefCookieManager : public virtual CefBase {
|
|||
|
||||
///
|
||||
// Flush the backing store (if any) to disk and execute the specified
|
||||
// |handler| on the IO thread when done. Returns false if cookies cannot be
|
||||
// |callback| on the IO thread when done. Returns false if cookies cannot be
|
||||
// accessed.
|
||||
///
|
||||
/*--cef(optional_param=handler)--*/
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionHandler> handler) =0;
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionCallback> callback) =0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_callback.h"
|
||||
|
||||
///
|
||||
// Implement this interface to receive notification when tracing has completed.
|
||||
|
@ -61,9 +62,9 @@ class CefEndTracingCallback : public virtual CefBase {
|
|||
|
||||
|
||||
///
|
||||
// Start tracing events on all processes. Tracing begins immediately locally,
|
||||
// and asynchronously on child processes as soon as they receive the
|
||||
// BeginTracing request.
|
||||
// Start tracing events on all processes. Tracing is initialized asynchronously
|
||||
// and |callback| will be executed on the UI thread after initialization is
|
||||
// complete.
|
||||
//
|
||||
// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is
|
||||
// pending, CefBeginTracing will fail and return false.
|
||||
|
@ -79,7 +80,8 @@ class CefEndTracingCallback : public virtual CefBase {
|
|||
// This function must be called on the browser process UI thread.
|
||||
///
|
||||
/*--cef(optional_param=categories)--*/
|
||||
bool CefBeginTracing(const CefString& categories);
|
||||
bool CefBeginTracing(const CefString& categories,
|
||||
CefRefPtr<CefCompletionCallback> callback);
|
||||
|
||||
///
|
||||
// Stop tracing events on all processes.
|
||||
|
@ -95,8 +97,8 @@ bool CefBeginTracing(const CefString& categories);
|
|||
// This function must be called on the browser process UI thread.
|
||||
///
|
||||
/*--cef(optional_param=tracing_file,optional_param=callback)--*/
|
||||
bool CefEndTracingAsync(const CefString& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback);
|
||||
bool CefEndTracing(const CefString& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback);
|
||||
|
||||
///
|
||||
// Returns the current system trace time or, if none is defined, the current
|
||||
|
|
|
@ -110,8 +110,8 @@ struct CefWindowInfoTraits {
|
|||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->parent_widget = src->parent_widget;
|
||||
target->window_rendering_disabled = src->window_rendering_disabled;
|
||||
target->transparent_painting = src->transparent_painting;
|
||||
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
|
||||
target->transparent_painting_enabled = src->transparent_painting_enabled;
|
||||
target->widget = src->widget;
|
||||
}
|
||||
};
|
||||
|
@ -125,17 +125,29 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
|||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(CefWindowHandle ParentWidget) {
|
||||
parent_widget = ParentWidget;
|
||||
///
|
||||
// Create the browser as a child widget.
|
||||
///
|
||||
void SetAsChild(CefWindowHandle parent) {
|
||||
parent_widget = parent;
|
||||
}
|
||||
|
||||
void SetTransparentPainting(bool transparentPainting) {
|
||||
transparent_painting = transparentPainting;
|
||||
}
|
||||
|
||||
void SetAsOffScreen(CefWindowHandle ParentWidget) {
|
||||
window_rendering_disabled = true;
|
||||
parent_widget = ParentWidget;
|
||||
///
|
||||
// Create the browser using windowless (off-screen) rendering. No widget
|
||||
// will be created for the browser and all rendering will occur via the
|
||||
// CefRenderHandler interface. The |parent| value will be used to identify
|
||||
// monitor info and to act as the parent widget for dialogs, context menus,
|
||||
// etc. If |parent| is not provided then the main screen monitor will be used
|
||||
// and some functionality that requires a parent widget may not function
|
||||
// correctly. If |transparent| is true a transparent background color will be
|
||||
// used (RGBA=0x00000000). If |transparent| is false the background will be
|
||||
// white and opaque. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
|
||||
windowless_rendering_enabled = true;
|
||||
parent_widget = parent;
|
||||
transparent_painting_enabled = transparent;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -112,8 +112,6 @@ struct CefWindowInfoTraits {
|
|||
|
||||
static inline void set(const struct_type* src, struct_type* target,
|
||||
bool copy) {
|
||||
target->view = src->view;
|
||||
target->parent_view = src->parent_view;
|
||||
cef_string_set(src->window_name.str, src->window_name.length,
|
||||
&target->window_name, copy);
|
||||
target->x = src->x;
|
||||
|
@ -121,8 +119,10 @@ struct CefWindowInfoTraits {
|
|||
target->width = src->width;
|
||||
target->height = src->height;
|
||||
target->hidden = src->hidden;
|
||||
target->transparent_painting = src->transparent_painting;
|
||||
target->window_rendering_disabled = src->window_rendering_disabled;
|
||||
target->parent_view = src->parent_view;
|
||||
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
|
||||
target->transparent_painting_enabled = src->transparent_painting_enabled;
|
||||
target->view = src->view;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -135,9 +135,12 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
|||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(CefWindowHandle ParentView, int x, int y, int width,
|
||||
///
|
||||
// Create the browser as a child view.
|
||||
///
|
||||
void SetAsChild(CefWindowHandle parent, int x, int y, int width,
|
||||
int height) {
|
||||
parent_view = ParentView;
|
||||
parent_view = parent;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->width = width;
|
||||
|
@ -145,13 +148,22 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
|||
hidden = false;
|
||||
}
|
||||
|
||||
void SetTransparentPainting(bool transparentPainting) {
|
||||
transparent_painting = transparentPainting;
|
||||
}
|
||||
|
||||
void SetAsOffScreen(NSView* view) {
|
||||
window_rendering_disabled = true;
|
||||
parent_view = view;
|
||||
///
|
||||
// Create the browser using windowless (off-screen) rendering. No view
|
||||
// will be created for the browser and all rendering will occur via the
|
||||
// CefRenderHandler interface. The |parent| value will be used to identify
|
||||
// monitor info and to act as the parent view for dialogs, context menus,
|
||||
// etc. If |parent| is not provided then the main screen monitor will be used
|
||||
// and some functionality that requires a parent view may not function
|
||||
// correctly. If |transparent| is true a transparent background color will be
|
||||
// used (RGBA=0x00000000). If |transparent| is false the background will be
|
||||
// white and opaque. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
|
||||
windowless_rendering_enabled = true;
|
||||
parent_view = parent;
|
||||
transparent_painting_enabled = transparent;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -223,6 +223,13 @@ typedef struct _cef_settings_t {
|
|||
///
|
||||
int multi_threaded_message_loop;
|
||||
|
||||
///
|
||||
// Set to true to enable windowless (off-screen) rendering support. Do not
|
||||
// enable this value if the application does not use windowless rendering as
|
||||
// it may reduce rendering performance on some systems.
|
||||
///
|
||||
bool windowless_rendering_enabled;
|
||||
|
||||
///
|
||||
// Set to true (1) to disable configuration of browser process features using
|
||||
// standard CEF and Chromium command-line arguments. Configuration can still
|
||||
|
@ -1650,14 +1657,11 @@ typedef enum {
|
|||
DOM_NODE_TYPE_ATTRIBUTE,
|
||||
DOM_NODE_TYPE_TEXT,
|
||||
DOM_NODE_TYPE_CDATA_SECTION,
|
||||
DOM_NODE_TYPE_ENTITY,
|
||||
DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS,
|
||||
DOM_NODE_TYPE_COMMENT,
|
||||
DOM_NODE_TYPE_DOCUMENT,
|
||||
DOM_NODE_TYPE_DOCUMENT_TYPE,
|
||||
DOM_NODE_TYPE_DOCUMENT_FRAGMENT,
|
||||
DOM_NODE_TYPE_NOTATION,
|
||||
DOM_NODE_TYPE_XPATH_NAMESPACE,
|
||||
} cef_dom_node_type_t;
|
||||
|
||||
///
|
||||
|
|
|
@ -60,18 +60,34 @@ typedef struct _cef_main_args_t {
|
|||
// Class representing window information.
|
||||
///
|
||||
typedef struct _cef_window_info_t {
|
||||
// Pointer for the parent GtkBox widget.
|
||||
///
|
||||
// Pointer for the parent widget.
|
||||
///
|
||||
cef_window_handle_t parent_widget;
|
||||
|
||||
// If window rendering is disabled no browser window will be created. Set
|
||||
// |parent_widget| to the window that will act as the parent for popup menus,
|
||||
// dialog boxes, etc.
|
||||
int window_rendering_disabled;
|
||||
///
|
||||
// Set to true (1) to create the browser using windowless (off-screen)
|
||||
// rendering. No widget will be created for the browser and all rendering will
|
||||
// occur via the CefRenderHandler interface. The |parent_widget| value will be
|
||||
// used to identify monitor info and to act as the parent widget for dialogs,
|
||||
// context menus, etc. If |parent_widget| is not provided then the main screen
|
||||
// monitor will be used and some functionality that requires a parent widget
|
||||
// may not function correctly. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
int windowless_rendering_enabled;
|
||||
|
||||
// Set to true to enable transparent painting.
|
||||
int transparent_painting;
|
||||
///
|
||||
// Set to true (1) to enable transparent painting in combination with
|
||||
// windowless rendering. When this value is true a transparent background
|
||||
// color will be used (RGBA=0x00000000). When this value is false the
|
||||
// background will be white and opaque.
|
||||
///
|
||||
int transparent_painting_enabled;
|
||||
|
||||
// Pointer for the new browser widget.
|
||||
///
|
||||
// Pointer for the new browser widget. Only used with windowed rendering.
|
||||
///
|
||||
cef_window_handle_t widget;
|
||||
} cef_window_info_t;
|
||||
|
||||
|
|
|
@ -82,20 +82,40 @@ typedef struct _cef_window_info_t {
|
|||
int y;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
///
|
||||
// Set to true (1) to create the view initially hidden.
|
||||
///
|
||||
int hidden;
|
||||
|
||||
///
|
||||
// NSView pointer for the parent view.
|
||||
///
|
||||
cef_window_handle_t parent_view;
|
||||
|
||||
// If window rendering is disabled no browser window will be created. Set
|
||||
// |parent_view| to the window that will act as the parent for popup menus,
|
||||
// dialog boxes, etc.
|
||||
int window_rendering_disabled;
|
||||
///
|
||||
// Set to true (1) to create the browser using windowless (off-screen)
|
||||
// rendering. No view will be created for the browser and all rendering will
|
||||
// occur via the CefRenderHandler interface. The |parent_view| value will be
|
||||
// used to identify monitor info and to act as the parent view for dialogs,
|
||||
// context menus, etc. If |parent_view| is not provided then the main screen
|
||||
// monitor will be used and some functionality that requires a parent view
|
||||
// may not function correctly. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
int windowless_rendering_enabled;
|
||||
|
||||
// Set to true to enable transparent painting.
|
||||
int transparent_painting;
|
||||
///
|
||||
// Set to true (1) to enable transparent painting in combination with
|
||||
// windowless rendering. When this value is true a transparent background
|
||||
// color will be used (RGBA=0x00000000). When this value is false the
|
||||
// background will be white and opaque.
|
||||
///
|
||||
int transparent_painting_enabled;
|
||||
|
||||
// NSView pointer for the new browser view.
|
||||
///
|
||||
// NSView pointer for the new browser view. Only used with windowed rendering.
|
||||
///
|
||||
cef_window_handle_t view;
|
||||
} cef_window_info_t;
|
||||
|
||||
|
|
|
@ -70,19 +70,29 @@ typedef struct _cef_window_info_t {
|
|||
cef_window_handle_t parent_window;
|
||||
HMENU menu;
|
||||
|
||||
// If window rendering is disabled no browser window will be created. Set
|
||||
// |parent_window| to be used for identifying monitor info
|
||||
// (MonitorFromWindow). If |parent_window| is not provided the main screen
|
||||
// monitor will be used.
|
||||
BOOL window_rendering_disabled;
|
||||
///
|
||||
// Set to true (1) to create the browser using windowless (off-screen)
|
||||
// rendering. No window will be created for the browser and all rendering will
|
||||
// occur via the CefRenderHandler interface. The |parent_window| value will be
|
||||
// used to identify monitor info and to act as the parent window for dialogs,
|
||||
// context menus, etc. If |parent_window| is not provided then the main screen
|
||||
// monitor will be used and some functionality that requires a parent window
|
||||
// may not function correctly. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
int windowless_rendering_enabled;
|
||||
|
||||
// Set to true to enable transparent painting.
|
||||
// If window rendering is disabled and |transparent_painting| is set to true
|
||||
// WebKit rendering will draw on a transparent background (RGBA=0x00000000).
|
||||
// When this value is false the background will be white and opaque.
|
||||
BOOL transparent_painting;
|
||||
///
|
||||
// Set to true (1) to enable transparent painting in combination with
|
||||
// windowless rendering. When this value is true a transparent background
|
||||
// color will be used (RGBA=0x00000000). When this value is false the
|
||||
// background will be white and opaque.
|
||||
///
|
||||
int transparent_painting_enabled;
|
||||
|
||||
// Handle for the new browser window.
|
||||
///
|
||||
// Handle for the new browser window. Only used with windowed rendering.
|
||||
///
|
||||
cef_window_handle_t window;
|
||||
} cef_window_info_t;
|
||||
|
||||
|
|
|
@ -349,6 +349,7 @@ struct CefSettingsTraits {
|
|||
src->browser_subprocess_path.length,
|
||||
&target->browser_subprocess_path, copy);
|
||||
target->multi_threaded_message_loop = src->multi_threaded_message_loop;
|
||||
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
|
||||
target->command_line_args_disabled = src->command_line_args_disabled;
|
||||
|
||||
cef_string_set(src->cache_path.str, src->cache_path.length,
|
||||
|
|
|
@ -119,9 +119,9 @@ struct CefWindowInfoTraits {
|
|||
target->height = src->height;
|
||||
target->parent_window = src->parent_window;
|
||||
target->menu = src->menu;
|
||||
target->transparent_painting_enabled = src->transparent_painting_enabled;
|
||||
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
|
||||
target->window = src->window;
|
||||
target->transparent_painting = src->transparent_painting;
|
||||
target->window_rendering_disabled = src->window_rendering_disabled;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -136,20 +136,26 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
|||
explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {}
|
||||
explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {}
|
||||
|
||||
void SetAsChild(HWND hWndParent, RECT windowRect) {
|
||||
///
|
||||
// Create the browser as a child window.
|
||||
///
|
||||
void SetAsChild(CefWindowHandle parent, RECT windowRect) {
|
||||
style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP |
|
||||
WS_VISIBLE;
|
||||
parent_window = hWndParent;
|
||||
parent_window = parent;
|
||||
x = windowRect.left;
|
||||
y = windowRect.top;
|
||||
width = windowRect.right - windowRect.left;
|
||||
height = windowRect.bottom - windowRect.top;
|
||||
}
|
||||
|
||||
void SetAsPopup(HWND hWndParent, const CefString& windowName) {
|
||||
///
|
||||
// Create the browser as a popup window.
|
||||
///
|
||||
void SetAsPopup(CefWindowHandle parent, const CefString& windowName) {
|
||||
style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
|
||||
WS_VISIBLE;
|
||||
parent_window = hWndParent;
|
||||
parent_window = parent;
|
||||
x = CW_USEDEFAULT;
|
||||
y = CW_USEDEFAULT;
|
||||
width = CW_USEDEFAULT;
|
||||
|
@ -158,13 +164,22 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
|
|||
cef_string_copy(windowName.c_str(), windowName.length(), &window_name);
|
||||
}
|
||||
|
||||
void SetTransparentPainting(BOOL transparentPainting) {
|
||||
transparent_painting = transparentPainting;
|
||||
}
|
||||
|
||||
void SetAsOffScreen(HWND hWndParent) {
|
||||
window_rendering_disabled = TRUE;
|
||||
parent_window = hWndParent;
|
||||
///
|
||||
// Create the browser using windowless (off-screen) rendering. No window
|
||||
// will be created for the browser and all rendering will occur via the
|
||||
// CefRenderHandler interface. The |parent| value will be used to identify
|
||||
// monitor info and to act as the parent window for dialogs, context menus,
|
||||
// etc. If |parent| is not provided then the main screen monitor will be used
|
||||
// and some functionality that requires a parent window may not function
|
||||
// correctly. If |transparent| is true a transparent background color will be
|
||||
// used (RGBA=0x00000000). If |transparent| is false the background will be
|
||||
// white and opaque. In order to create windowless browsers the
|
||||
// CefSettings.windowless_rendering_enabled value must be set to true.
|
||||
///
|
||||
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
|
||||
windowless_rendering_enabled = TRUE;
|
||||
parent_window = parent;
|
||||
transparent_painting_enabled = transparent;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -267,6 +267,19 @@ void CefBrowserContextImpl::CancelMIDISysExPermissionRequest(
|
|||
const GURL& requesting_frame) {
|
||||
}
|
||||
|
||||
void CefBrowserContextImpl::RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) {
|
||||
}
|
||||
|
||||
void CefBrowserContextImpl::CancelProtectedMediaIdentifierPermissionRequests(
|
||||
int group_id) {
|
||||
}
|
||||
|
||||
content::ResourceContext* CefBrowserContextImpl::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
|
|
@ -50,6 +50,15 @@ class CefBrowserContextImpl : public CefBrowserContext {
|
|||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) OVERRIDE;
|
||||
virtual void RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelProtectedMediaIdentifierPermissionRequests(
|
||||
int group_id) OVERRIDE;
|
||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||
virtual content::GeolocationPermissionContext*
|
||||
GetGeolocationPermissionContext() OVERRIDE;
|
||||
|
|
|
@ -129,6 +129,19 @@ void CefBrowserContextProxy::CancelMIDISysExPermissionRequest(
|
|||
const GURL& requesting_frame) {
|
||||
}
|
||||
|
||||
void CefBrowserContextProxy::RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) {
|
||||
}
|
||||
|
||||
void CefBrowserContextProxy::CancelProtectedMediaIdentifierPermissionRequests(
|
||||
int group_id) {
|
||||
}
|
||||
|
||||
content::ResourceContext* CefBrowserContextProxy::GetResourceContext() {
|
||||
return resource_context_.get();
|
||||
}
|
||||
|
|
|
@ -58,6 +58,15 @@ class CefBrowserContextProxy : public CefBrowserContext {
|
|||
int render_view_id,
|
||||
int bridge_id,
|
||||
const GURL& requesting_frame) OVERRIDE;
|
||||
virtual void RequestProtectedMediaIdentifierPermission(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int bridge_id,
|
||||
int group_id,
|
||||
const GURL& requesting_frame,
|
||||
const ProtectedMediaIdentifierPermissionCallback& callback) OVERRIDE;
|
||||
virtual void CancelProtectedMediaIdentifierPermissionRequests(
|
||||
int group_id) OVERRIDE;
|
||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||
virtual content::GeolocationPermissionContext*
|
||||
GetGeolocationPermissionContext() OVERRIDE;
|
||||
|
|
|
@ -290,6 +290,10 @@ bool CefBrowserHost::CreateBrowser(
|
|||
|
||||
// Verify that render handler is in place for a windowless browser.
|
||||
if (CefBrowserHostImpl::IsWindowRenderingDisabled(windowInfo)) {
|
||||
if (!CefContext::Get()->settings().windowless_rendering_enabled) {
|
||||
NOTREACHED() << "Windowless rendering must be enabled";
|
||||
return false;
|
||||
}
|
||||
if (!client->GetRenderHandler().get()) {
|
||||
NOTREACHED() << "CefRenderHandler implementation is required";
|
||||
return false;
|
||||
|
@ -358,6 +362,10 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::Create(
|
|||
|
||||
// Verify that render handler is in place for a windowless browser.
|
||||
if (CefBrowserHostImpl::IsWindowRenderingDisabled(windowInfo)) {
|
||||
if (!CefContext::Get()->settings().windowless_rendering_enabled) {
|
||||
NOTREACHED() << "Windowless rendering must be enabled";
|
||||
return NULL;
|
||||
}
|
||||
if (!client->GetRenderHandler().get()) {
|
||||
NOTREACHED() << "CefRenderHandler implementation is required";
|
||||
return NULL;
|
||||
|
@ -715,8 +723,8 @@ double CefBrowserHostImpl::GetZoomLevel() {
|
|||
|
||||
void CefBrowserHostImpl::SetZoomLevel(double zoomLevel) {
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
if (web_contents_.get() && web_contents_->GetRenderViewHost())
|
||||
web_contents_->GetRenderViewHost()->SetZoomLevel(zoomLevel);
|
||||
if (web_contents_.get())
|
||||
web_contents_->SetZoomLevel(zoomLevel);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::SetZoomLevel, this, zoomLevel));
|
||||
|
@ -812,7 +820,7 @@ void CefBrowserHostImpl::Find(int identifier, const CefString& searchText,
|
|||
options.forward = forward;
|
||||
options.matchCase = matchCase;
|
||||
options.findNext = findNext;
|
||||
web_contents()->GetRenderViewHost()->Find(identifier, searchText, options);
|
||||
web_contents()->Find(identifier, searchText, options);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::Find, this, identifier, searchText,
|
||||
|
@ -828,7 +836,7 @@ void CefBrowserHostImpl::StopFinding(bool clearSelection) {
|
|||
content::StopFindAction action = clearSelection ?
|
||||
content::STOP_FIND_ACTION_CLEAR_SELECTION :
|
||||
content::STOP_FIND_ACTION_KEEP_SELECTION;
|
||||
web_contents()->GetRenderViewHost()->StopFinding(action);
|
||||
web_contents()->StopFinding(action);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::StopFinding, this, clearSelection));
|
||||
|
@ -1846,9 +1854,10 @@ void CefBrowserHostImpl::WebContentsFocused(content::WebContents* contents) {
|
|||
}
|
||||
|
||||
bool CefBrowserHostImpl::HandleContextMenu(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::ContextMenuParams& params) {
|
||||
if (!menu_creator_.get())
|
||||
menu_creator_.reset(new CefMenuCreator(this));
|
||||
menu_creator_.reset(new CefMenuCreator(this, render_frame_host));
|
||||
return menu_creator_->CreateContextMenu(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -330,8 +330,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||
virtual bool TakeFocus(content::WebContents* source,
|
||||
bool reverse) OVERRIDE;
|
||||
virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
|
||||
virtual bool HandleContextMenu(const content::ContextMenuParams& params)
|
||||
OVERRIDE;
|
||||
virtual bool HandleContextMenu(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::ContextMenuParams& params) OVERRIDE;
|
||||
virtual bool PreHandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event,
|
||||
|
|
|
@ -385,11 +385,11 @@ void CefBrowserHostImpl::PlatformHandleExternalProtocol(const GURL& url) {
|
|||
|
||||
// static
|
||||
bool CefBrowserHostImpl::IsWindowRenderingDisabled(const CefWindowInfo& info) {
|
||||
return info.window_rendering_disabled ? true : false;
|
||||
return info.windowless_rendering_enabled ? true : false;
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsTransparent() {
|
||||
return window_info_.transparent_painting != 0;
|
||||
return window_info_.transparent_painting_enabled ? true : false;
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::PlatformTranslateKeyEvent(
|
||||
|
|
|
@ -436,7 +436,11 @@ void CefBrowserHostImpl::PlatformHandleExternalProtocol(const GURL& url) {
|
|||
|
||||
// static
|
||||
bool CefBrowserHostImpl::IsWindowRenderingDisabled(const CefWindowInfo& info) {
|
||||
return info.window_rendering_disabled ? true : false;
|
||||
return info.windowless_rendering_enabled ? true : false;
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsTransparent() {
|
||||
return window_info_.transparent_painting_enabled ? true : false;
|
||||
}
|
||||
|
||||
static NSTimeInterval currentEventTimestamp() {
|
||||
|
@ -453,10 +457,6 @@ static NSTimeInterval currentEventTimestamp() {
|
|||
}
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsTransparent() {
|
||||
return window_info_.transparent_painting != 0;
|
||||
}
|
||||
|
||||
static NSUInteger NativeModifiers(int cef_modifiers) {
|
||||
NSUInteger native_modifiers = 0;
|
||||
if (cef_modifiers & EVENTFLAG_SHIFT_DOWN)
|
||||
|
|
|
@ -701,7 +701,7 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message,
|
|||
case WM_DWMCOMPOSITIONCHANGED:
|
||||
// Message sent to top-level windows when composition has been enabled or
|
||||
// disabled.
|
||||
if (browser && browser->window_info_.transparent_painting)
|
||||
if (browser && browser->IsTransparent())
|
||||
SetAeroGlass(hwnd);
|
||||
break;
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() {
|
|||
if (!window_info_.window)
|
||||
return false;
|
||||
|
||||
if (window_info_.transparent_painting &&
|
||||
if (window_info_.transparent_painting_enabled &&
|
||||
!(window_info_.style & WS_CHILD)) {
|
||||
// Transparent top-level windows will be given "sheet of glass" effect.
|
||||
SetAeroGlass(window_info_.window);
|
||||
|
@ -885,11 +885,11 @@ void CefBrowserHostImpl::PlatformHandleExternalProtocol(const GURL& url) {
|
|||
|
||||
// static
|
||||
bool CefBrowserHostImpl::IsWindowRenderingDisabled(const CefWindowInfo& info) {
|
||||
return info.window_rendering_disabled ? true : false;
|
||||
return info.windowless_rendering_enabled ? true : false;
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsTransparent() {
|
||||
return window_info_.transparent_painting != 0;
|
||||
return window_info_.transparent_painting_enabled ? true : false;
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::PlatformTranslateKeyEvent(
|
||||
|
|
|
@ -70,7 +70,7 @@ void CefBrowserMainParts::PostMainMessageLoopStart() {
|
|||
content::ContentWebUIControllerFactory::GetInstance());
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
printing::PrintingContextGtk::SetCreatePrintDialogFunction(
|
||||
printing::PrintingContextLinux::SetCreatePrintDialogFunction(
|
||||
&PrintDialogGtk::CreatePrintDialog);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -225,7 +225,8 @@ prerender::PrerenderTracker* ChromeBrowserProcessStub::prerender_tracker() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ComponentUpdateService* ChromeBrowserProcessStub::component_updater() {
|
||||
component_updater::ComponentUpdateService*
|
||||
ChromeBrowserProcessStub::component_updater() {
|
||||
NOTIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -235,8 +236,8 @@ CRLSetFetcher* ChromeBrowserProcessStub::crl_set_fetcher() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PnaclComponentInstaller*
|
||||
ChromeBrowserProcessStub::pnacl_component_installer() {
|
||||
component_updater::PnaclComponentInstaller*
|
||||
ChromeBrowserProcessStub::pnacl_component_installer() {
|
||||
NOTIMPLEMENTED();
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -82,9 +82,11 @@ class ChromeBrowserProcessStub : public BrowserProcess {
|
|||
|
||||
virtual ChromeNetLog* net_log() OVERRIDE;
|
||||
virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE;
|
||||
virtual ComponentUpdateService* component_updater() OVERRIDE;
|
||||
virtual component_updater::ComponentUpdateService*
|
||||
component_updater() OVERRIDE;
|
||||
virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE;
|
||||
virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE;
|
||||
virtual component_updater::PnaclComponentInstaller*
|
||||
pnacl_component_installer() OVERRIDE;
|
||||
virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE;
|
||||
virtual MediaFileSystemRegistry*
|
||||
media_file_system_registry() OVERRIDE;
|
||||
|
|
|
@ -81,9 +81,9 @@ bool GetCookieDomain(const GURL& url,
|
|||
result);
|
||||
}
|
||||
|
||||
void RunCompletionOnIOThread(CefRefPtr<CefCompletionHandler> handler) {
|
||||
void RunCompletionOnIOThread(CefRefPtr<CefCompletionCallback> callback) {
|
||||
CEF_POST_TASK(CEF_IOT,
|
||||
base::Bind(&CefCompletionHandler::OnComplete, handler.get()));
|
||||
base::Bind(&CefCompletionCallback::OnComplete, callback.get()));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -300,7 +300,7 @@ bool CefCookieManagerImpl::SetStoragePath(
|
|||
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
|
||||
persist_session_cookies,
|
||||
NULL,
|
||||
scoped_ptr<content::CookieCryptoDelegate>());
|
||||
NULL);
|
||||
} else {
|
||||
NOTREACHED() << "The cookie storage directory could not be created";
|
||||
storage_path_.clear();
|
||||
|
@ -327,26 +327,27 @@ bool CefCookieManagerImpl::SetStoragePath(
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CefCookieManagerImpl::FlushStore(CefRefPtr<CefCompletionHandler> handler) {
|
||||
bool CefCookieManagerImpl::FlushStore(
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
if (CEF_CURRENTLY_ON_IOT()) {
|
||||
if (!cookie_monster_) {
|
||||
if (handler.get())
|
||||
RunCompletionOnIOThread(handler);
|
||||
if (callback.get())
|
||||
RunCompletionOnIOThread(callback);
|
||||
return true;
|
||||
}
|
||||
|
||||
base::Closure callback;
|
||||
if (handler.get())
|
||||
callback = base::Bind(RunCompletionOnIOThread, handler);
|
||||
base::Closure flush_callback;
|
||||
if (callback.get())
|
||||
flush_callback = base::Bind(RunCompletionOnIOThread, callback);
|
||||
else
|
||||
callback = base::Bind(&base::DoNothing);
|
||||
flush_callback = base::Bind(&base::DoNothing);
|
||||
|
||||
cookie_monster_->FlushStore(callback);
|
||||
cookie_monster_->FlushStore(flush_callback);
|
||||
} else {
|
||||
// Execute on the IO thread.
|
||||
CEF_POST_TASK(CEF_IOT,
|
||||
base::Bind(base::IgnoreResult(&CefCookieManagerImpl::FlushStore),
|
||||
this, handler));
|
||||
this, callback));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -31,7 +31,7 @@ class CefCookieManagerImpl : public CefCookieManager {
|
|||
const CefString& cookie_name) OVERRIDE;
|
||||
virtual bool SetStoragePath(const CefString& path,
|
||||
bool persist_session_cookies) OVERRIDE;
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionHandler> handler) OVERRIDE;
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionCallback> callback) OVERRIDE;
|
||||
|
||||
net::CookieMonster* cookie_monster() { return cookie_monster_; }
|
||||
|
||||
|
|
|
@ -1,215 +1,216 @@
|
|||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||
|
||||
#include "base/prefs/pref_registry_simple.h"
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/media_devices_monitor.h"
|
||||
#include "content/public/common/media_stream_request.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
using content::MediaStreamDevices;
|
||||
|
||||
namespace {
|
||||
|
||||
const content::MediaStreamDevice* FindDefaultDeviceWithId(
|
||||
const content::MediaStreamDevices& devices,
|
||||
const std::string& device_id) {
|
||||
if (devices.empty())
|
||||
return NULL;
|
||||
|
||||
content::MediaStreamDevices::const_iterator iter = devices.begin();
|
||||
for (; iter != devices.end(); ++iter) {
|
||||
if (iter->id == device_id) {
|
||||
return &(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
return &(*devices.begin());
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
CefMediaCaptureDevicesDispatcher*
|
||||
CefMediaCaptureDevicesDispatcher::GetInstance() {
|
||||
return Singleton<CefMediaCaptureDevicesDispatcher>::get();
|
||||
}
|
||||
|
||||
CefMediaCaptureDevicesDispatcher::CefMediaCaptureDevicesDispatcher()
|
||||
: devices_enumerated_(false) {}
|
||||
|
||||
CefMediaCaptureDevicesDispatcher::~CefMediaCaptureDevicesDispatcher() {}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::RegisterPrefs(
|
||||
PrefRegistrySimple* registry) {
|
||||
registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice,
|
||||
std::string());
|
||||
registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice,
|
||||
std::string());
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::AddObserver(Observer* observer) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!observers_.HasObserver(observer))
|
||||
observers_.AddObserver(observer);
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::RemoveObserver(Observer* observer) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
observers_.RemoveObserver(observer);
|
||||
}
|
||||
|
||||
const MediaStreamDevices&
|
||||
CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!devices_enumerated_) {
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&content::EnsureMonitorCaptureDevices));
|
||||
devices_enumerated_ = true;
|
||||
}
|
||||
return audio_devices_;
|
||||
}
|
||||
|
||||
const MediaStreamDevices&
|
||||
CefMediaCaptureDevicesDispatcher::GetVideoCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!devices_enumerated_) {
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&content::EnsureMonitorCaptureDevices));
|
||||
devices_enumerated_ = true;
|
||||
}
|
||||
return video_devices_;
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::GetDefaultDevices(
|
||||
PrefService* prefs,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
DCHECK(audio || video);
|
||||
|
||||
std::string default_device;
|
||||
if (audio) {
|
||||
default_device = prefs->GetString(prefs::kDefaultAudioCaptureDevice);
|
||||
GetRequestedDevice(default_device, true, false, devices);
|
||||
}
|
||||
|
||||
if (video) {
|
||||
default_device = prefs->GetString(prefs::kDefaultVideoCaptureDevice);
|
||||
GetRequestedDevice(default_device, false, true, devices);
|
||||
}
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::GetRequestedDevice(
|
||||
const std::string& requested_device_id,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
DCHECK(audio || video);
|
||||
|
||||
if (audio) {
|
||||
const content::MediaStreamDevices& audio_devices = GetAudioCaptureDevices();
|
||||
const content::MediaStreamDevice* const device =
|
||||
FindDefaultDeviceWithId(audio_devices, requested_device_id);
|
||||
if (device)
|
||||
devices->push_back(*device);
|
||||
}
|
||||
if (video) {
|
||||
const content::MediaStreamDevices& video_devices = GetVideoCaptureDevices();
|
||||
const content::MediaStreamDevice* const device =
|
||||
FindDefaultDeviceWithId(video_devices, requested_device_id);
|
||||
if (device)
|
||||
devices->push_back(*device);
|
||||
}
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread,
|
||||
base::Unretained(this), devices));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread,
|
||||
base::Unretained(this), devices));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
|
||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||
|
||||
#include "base/prefs/pref_registry_simple.h"
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/media_devices_monitor.h"
|
||||
#include "content/public/common/media_stream_request.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
using content::MediaStreamDevices;
|
||||
|
||||
namespace {
|
||||
|
||||
const content::MediaStreamDevice* FindDefaultDeviceWithId(
|
||||
const content::MediaStreamDevices& devices,
|
||||
const std::string& device_id) {
|
||||
if (devices.empty())
|
||||
return NULL;
|
||||
|
||||
content::MediaStreamDevices::const_iterator iter = devices.begin();
|
||||
for (; iter != devices.end(); ++iter) {
|
||||
if (iter->id == device_id) {
|
||||
return &(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
return &(*devices.begin());
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
CefMediaCaptureDevicesDispatcher*
|
||||
CefMediaCaptureDevicesDispatcher::GetInstance() {
|
||||
return Singleton<CefMediaCaptureDevicesDispatcher>::get();
|
||||
}
|
||||
|
||||
CefMediaCaptureDevicesDispatcher::CefMediaCaptureDevicesDispatcher()
|
||||
: devices_enumerated_(false) {}
|
||||
|
||||
CefMediaCaptureDevicesDispatcher::~CefMediaCaptureDevicesDispatcher() {}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::RegisterPrefs(
|
||||
PrefRegistrySimple* registry) {
|
||||
registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice,
|
||||
std::string());
|
||||
registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice,
|
||||
std::string());
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::AddObserver(Observer* observer) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!observers_.HasObserver(observer))
|
||||
observers_.AddObserver(observer);
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::RemoveObserver(Observer* observer) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
observers_.RemoveObserver(observer);
|
||||
}
|
||||
|
||||
const MediaStreamDevices&
|
||||
CefMediaCaptureDevicesDispatcher::GetAudioCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!devices_enumerated_) {
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&content::EnsureMonitorCaptureDevices));
|
||||
devices_enumerated_ = true;
|
||||
}
|
||||
return audio_devices_;
|
||||
}
|
||||
|
||||
const MediaStreamDevices&
|
||||
CefMediaCaptureDevicesDispatcher::GetVideoCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (!devices_enumerated_) {
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::IO, FROM_HERE,
|
||||
base::Bind(&content::EnsureMonitorCaptureDevices));
|
||||
devices_enumerated_ = true;
|
||||
}
|
||||
return video_devices_;
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::GetDefaultDevices(
|
||||
PrefService* prefs,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
DCHECK(audio || video);
|
||||
|
||||
std::string default_device;
|
||||
if (audio) {
|
||||
default_device = prefs->GetString(prefs::kDefaultAudioCaptureDevice);
|
||||
GetRequestedDevice(default_device, true, false, devices);
|
||||
}
|
||||
|
||||
if (video) {
|
||||
default_device = prefs->GetString(prefs::kDefaultVideoCaptureDevice);
|
||||
GetRequestedDevice(default_device, false, true, devices);
|
||||
}
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::GetRequestedDevice(
|
||||
const std::string& requested_device_id,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
DCHECK(audio || video);
|
||||
|
||||
if (audio) {
|
||||
const content::MediaStreamDevices& audio_devices = GetAudioCaptureDevices();
|
||||
const content::MediaStreamDevice* const device =
|
||||
FindDefaultDeviceWithId(audio_devices, requested_device_id);
|
||||
if (device)
|
||||
devices->push_back(*device);
|
||||
}
|
||||
if (video) {
|
||||
const content::MediaStreamDevices& video_devices = GetVideoCaptureDevices();
|
||||
const content::MediaStreamDevice* const device =
|
||||
FindDefaultDeviceWithId(video_devices, requested_device_id);
|
||||
if (device)
|
||||
devices->push_back(*device);
|
||||
}
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread,
|
||||
base::Unretained(this), devices));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread,
|
||||
base::Unretained(this), devices));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const GURL& security_origin,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread,
|
||||
base::Unretained(this), render_process_id, render_view_id,
|
||||
page_request_id, device, state));
|
||||
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged(
|
||||
content::MediaRequestState state) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(
|
||||
&CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread,
|
||||
base::Unretained(this), render_process_id, render_view_id,
|
||||
page_request_id, device, state));
|
||||
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int stream_id,
|
||||
bool is_playing,
|
||||
float power_dbfs,
|
||||
bool clipped) {
|
||||
}
|
||||
|
||||
bool clipped) {
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream(
|
||||
int render_process_id,
|
||||
int render_view_id) {
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
devices_enumerated_ = true;
|
||||
audio_devices_ = devices;
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnUpdateAudioDevices(audio_devices_));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread(
|
||||
const content::MediaStreamDevices& devices){
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
devices_enumerated_ = true;
|
||||
video_devices_ = devices;
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnUpdateVideoDevices(video_devices_));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state) {
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnRequestUpdate(render_process_id,
|
||||
render_view_id,
|
||||
page_request_id,
|
||||
device,
|
||||
state));
|
||||
}
|
||||
int render_view_id) {
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread(
|
||||
const content::MediaStreamDevices& devices) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
devices_enumerated_ = true;
|
||||
audio_devices_ = devices;
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnUpdateAudioDevices(audio_devices_));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread(
|
||||
const content::MediaStreamDevices& devices){
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
devices_enumerated_ = true;
|
||||
video_devices_ = devices;
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnUpdateVideoDevices(video_devices_));
|
||||
}
|
||||
|
||||
void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state) {
|
||||
FOR_EACH_OBSERVER(Observer, observers_,
|
||||
OnRequestUpdate(render_process_id,
|
||||
render_view_id,
|
||||
page_request_id,
|
||||
device,
|
||||
state));
|
||||
}
|
||||
|
|
|
@ -1,127 +1,128 @@
|
|||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
#define CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "content/public/browser/media_observer.h"
|
||||
#include "content/public/common/media_stream_request.h"
|
||||
|
||||
class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
|
||||
// This singleton is used to receive updates about media events from the content
|
||||
// layer. Based on chrome/browser/media/media_capture_devices_dispatcher.[h|cc].
|
||||
class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
|
||||
public:
|
||||
class Observer {
|
||||
public:
|
||||
// Handle an information update consisting of a up-to-date audio capture
|
||||
// device lists. This happens when a microphone is plugged in or unplugged.
|
||||
virtual void OnUpdateAudioDevices(
|
||||
const content::MediaStreamDevices& devices) {}
|
||||
|
||||
// Handle an information update consisting of a up-to-date video capture
|
||||
// device lists. This happens when a camera is plugged in or unplugged.
|
||||
virtual void OnUpdateVideoDevices(
|
||||
const content::MediaStreamDevices& devices) {}
|
||||
|
||||
// Handle an information update related to a media stream request.
|
||||
virtual void OnRequestUpdate(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
const content::MediaRequestState state) {}
|
||||
|
||||
virtual ~Observer() {}
|
||||
};
|
||||
|
||||
static CefMediaCaptureDevicesDispatcher* GetInstance();
|
||||
|
||||
// Registers the preferences related to Media Stream default devices.
|
||||
static void RegisterPrefs(PrefRegistrySimple* registry);
|
||||
|
||||
// Methods for observers. Called on UI thread.
|
||||
// Observers should add themselves on construction and remove themselves
|
||||
// on destruction.
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
const content::MediaStreamDevices& GetAudioCaptureDevices();
|
||||
const content::MediaStreamDevices& GetVideoCaptureDevices();
|
||||
|
||||
// Helper to get the default devices which can be used by the media request,
|
||||
// if the return list is empty, it means there is no available device on the
|
||||
// OS.
|
||||
// Called on the UI thread.
|
||||
void GetDefaultDevices(PrefService* prefs,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices);
|
||||
|
||||
// Helper for picking the device that was requested for an OpenDevice request.
|
||||
// If the device requested is not available it will revert to using the first
|
||||
// available one instead or will return an empty list if no devices of the
|
||||
// requested kind are present.
|
||||
void GetRequestedDevice(const std::string& requested_device_id,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices);
|
||||
|
||||
// Overridden from content::MediaObserver:
|
||||
virtual void OnAudioCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) OVERRIDE;
|
||||
virtual void OnVideoCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) OVERRIDE;
|
||||
virtual void OnMediaRequestStateChanged(
|
||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
#define CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "content/public/browser/media_observer.h"
|
||||
#include "content/public/common/media_stream_request.h"
|
||||
|
||||
class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
|
||||
// This singleton is used to receive updates about media events from the content
|
||||
// layer. Based on chrome/browser/media/media_capture_devices_dispatcher.[h|cc].
|
||||
class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
|
||||
public:
|
||||
class Observer {
|
||||
public:
|
||||
// Handle an information update consisting of a up-to-date audio capture
|
||||
// device lists. This happens when a microphone is plugged in or unplugged.
|
||||
virtual void OnUpdateAudioDevices(
|
||||
const content::MediaStreamDevices& devices) {}
|
||||
|
||||
// Handle an information update consisting of a up-to-date video capture
|
||||
// device lists. This happens when a camera is plugged in or unplugged.
|
||||
virtual void OnUpdateVideoDevices(
|
||||
const content::MediaStreamDevices& devices) {}
|
||||
|
||||
// Handle an information update related to a media stream request.
|
||||
virtual void OnRequestUpdate(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
const content::MediaRequestState state) {}
|
||||
|
||||
virtual ~Observer() {}
|
||||
};
|
||||
|
||||
static CefMediaCaptureDevicesDispatcher* GetInstance();
|
||||
|
||||
// Registers the preferences related to Media Stream default devices.
|
||||
static void RegisterPrefs(PrefRegistrySimple* registry);
|
||||
|
||||
// Methods for observers. Called on UI thread.
|
||||
// Observers should add themselves on construction and remove themselves
|
||||
// on destruction.
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
const content::MediaStreamDevices& GetAudioCaptureDevices();
|
||||
const content::MediaStreamDevices& GetVideoCaptureDevices();
|
||||
|
||||
// Helper to get the default devices which can be used by the media request,
|
||||
// if the return list is empty, it means there is no available device on the
|
||||
// OS.
|
||||
// Called on the UI thread.
|
||||
void GetDefaultDevices(PrefService* prefs,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices);
|
||||
|
||||
// Helper for picking the device that was requested for an OpenDevice request.
|
||||
// If the device requested is not available it will revert to using the first
|
||||
// available one instead or will return an empty list if no devices of the
|
||||
// requested kind are present.
|
||||
void GetRequestedDevice(const std::string& requested_device_id,
|
||||
bool audio,
|
||||
bool video,
|
||||
content::MediaStreamDevices* devices);
|
||||
|
||||
// Overridden from content::MediaObserver:
|
||||
virtual void OnAudioCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) OVERRIDE;
|
||||
virtual void OnVideoCaptureDevicesChanged(
|
||||
const content::MediaStreamDevices& devices) OVERRIDE;
|
||||
virtual void OnMediaRequestStateChanged(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const GURL& security_origin,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state) OVERRIDE;
|
||||
virtual void OnAudioStreamPlayingChanged(
|
||||
content::MediaRequestState state) OVERRIDE;
|
||||
virtual void OnAudioStreamPlayingChanged(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int stream_id,
|
||||
bool is_playing,
|
||||
float power_dbfs,
|
||||
bool clipped) OVERRIDE;
|
||||
bool clipped) OVERRIDE;
|
||||
virtual void OnCreatingAudioStream(int render_process_id,
|
||||
int render_view_id) OVERRIDE;
|
||||
|
||||
private:
|
||||
friend struct DefaultSingletonTraits<CefMediaCaptureDevicesDispatcher>;
|
||||
|
||||
CefMediaCaptureDevicesDispatcher();
|
||||
virtual ~CefMediaCaptureDevicesDispatcher();
|
||||
|
||||
// Called by the MediaObserver() functions, executed on UI thread.
|
||||
void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
||||
void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
||||
void UpdateMediaRequestStateOnUIThread(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state);
|
||||
|
||||
// A list of cached audio capture devices.
|
||||
content::MediaStreamDevices audio_devices_;
|
||||
|
||||
// A list of cached video capture devices.
|
||||
content::MediaStreamDevices video_devices_;
|
||||
|
||||
// A list of observers for the device update notifications.
|
||||
ObserverList<Observer> observers_;
|
||||
|
||||
// Flag to indicate if device enumeration has been done/doing.
|
||||
// Only accessed on UI thread.
|
||||
bool devices_enumerated_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
int render_view_id) OVERRIDE;
|
||||
|
||||
private:
|
||||
friend struct DefaultSingletonTraits<CefMediaCaptureDevicesDispatcher>;
|
||||
|
||||
CefMediaCaptureDevicesDispatcher();
|
||||
virtual ~CefMediaCaptureDevicesDispatcher();
|
||||
|
||||
// Called by the MediaObserver() functions, executed on UI thread.
|
||||
void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
||||
void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
||||
void UpdateMediaRequestStateOnUIThread(
|
||||
int render_process_id,
|
||||
int render_view_id,
|
||||
int page_request_id,
|
||||
const content::MediaStreamDevice& device,
|
||||
content::MediaRequestState state);
|
||||
|
||||
// A list of cached audio capture devices.
|
||||
content::MediaStreamDevices audio_devices_;
|
||||
|
||||
// A list of cached video capture devices.
|
||||
content::MediaStreamDevices video_devices_;
|
||||
|
||||
// A list of observers for the device update notifications.
|
||||
ObserverList<Observer> observers_;
|
||||
|
||||
// Flag to indicate if device enumeration has been done/doing.
|
||||
// Only accessed on UI thread.
|
||||
bool devices_enumerated_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "grit/cef_strings.h"
|
||||
|
||||
|
@ -32,8 +33,12 @@ CefString GetLabel(int message_id) {
|
|||
|
||||
} // namespace
|
||||
|
||||
CefMenuCreator::CefMenuCreator(CefBrowserHostImpl* browser)
|
||||
CefMenuCreator::CefMenuCreator(CefBrowserHostImpl* browser,
|
||||
content::RenderFrameHost* render_frame_host)
|
||||
: browser_(browser) {
|
||||
DCHECK(render_frame_host);
|
||||
render_process_id_ = render_frame_host->GetProcess()->GetID();
|
||||
render_frame_id_ = render_frame_host->GetRoutingID();
|
||||
model_ = new CefMenuModelImpl(this);
|
||||
}
|
||||
|
||||
|
@ -199,10 +204,10 @@ void CefMenuCreator::MenuClosed(CefRefPtr<CefMenuModelImpl> source) {
|
|||
browser_->GetWebContents()->GetRenderWidgetHostView();
|
||||
if (view)
|
||||
view->SetShowingContextMenu(false);
|
||||
content::RenderViewHost* rvh =
|
||||
browser_->GetWebContents()->GetRenderViewHost();
|
||||
if (rvh)
|
||||
rvh->NotifyContextMenuClosed(params_.custom_context);
|
||||
content::RenderFrameHost* render_frame_host =
|
||||
content::RenderFrameHost::FromID(render_process_id_, render_frame_id_);
|
||||
if (render_frame_host)
|
||||
render_frame_host->NotifyContextMenuClosed(params_.custom_context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
#include "base/memory/scoped_ptr.h"
|
||||
#include "content/public/common/context_menu_params.h"
|
||||
|
||||
namespace content {
|
||||
class RenderFrameHost;
|
||||
};
|
||||
|
||||
class CefBrowserHostImpl;
|
||||
|
||||
class CefMenuCreator : public CefMenuModelImpl::Delegate {
|
||||
|
@ -22,7 +26,8 @@ class CefMenuCreator : public CefMenuModelImpl::Delegate {
|
|||
virtual bool RunContextMenu(CefMenuCreator* manager) =0;
|
||||
};
|
||||
|
||||
explicit CefMenuCreator(CefBrowserHostImpl* browser);
|
||||
CefMenuCreator(CefBrowserHostImpl* browser,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
virtual ~CefMenuCreator();
|
||||
|
||||
// Returns true if the context menu is currently showing.
|
||||
|
@ -53,6 +58,11 @@ class CefMenuCreator : public CefMenuModelImpl::Delegate {
|
|||
|
||||
// CefBrowserHostImpl pointer is guaranteed to outlive this object.
|
||||
CefBrowserHostImpl* browser_;
|
||||
|
||||
// The RenderFrameHost's IDs.
|
||||
int render_process_id_;
|
||||
int render_frame_id_;
|
||||
|
||||
CefRefPtr<CefMenuModelImpl> model_;
|
||||
content::ContextMenuParams params_;
|
||||
scoped_ptr<Runner> runner_;
|
||||
|
|
|
@ -9,10 +9,11 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "libcef/common/upload_data.h"
|
||||
|
||||
#include "content/public/browser/global_request_id.h"
|
||||
#include "content/public/common/page_transition_types.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
|
|
|
@ -369,7 +369,8 @@ content::BackingStore* CefRenderWidgetHostViewOSR::AllocBackingStore(
|
|||
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurface(
|
||||
const gfx::Rect& src_subrect,
|
||||
const gfx::Size& dst_size,
|
||||
const base::Callback<void(bool, const SkBitmap&)>& callback) {
|
||||
const base::Callback<void(bool, const SkBitmap&)>& callback,
|
||||
const SkBitmap::Config config) {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceToVideoFrame(
|
||||
|
|
|
@ -156,7 +156,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
|
|||
virtual void CopyFromCompositingSurface(
|
||||
const gfx::Rect& src_subrect,
|
||||
const gfx::Size& dst_size,
|
||||
const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE;
|
||||
const base::Callback<void(bool, const SkBitmap&)>& callback,
|
||||
const SkBitmap::Config config) OVERRIDE;
|
||||
virtual void CopyFromCompositingSurfaceToVideoFrame(
|
||||
const gfx::Rect& src_subrect,
|
||||
const scoped_refptr<media::VideoFrame>& target,
|
||||
|
|
|
@ -25,7 +25,7 @@ void InstallInternalProtectedHandlers(
|
|||
content::ProtocolHandlerMap* protocol_handlers,
|
||||
net::FtpTransactionFactory* ftp_transaction_factory) {
|
||||
protocol_handlers->insert(
|
||||
std::make_pair(chrome::kDataScheme,
|
||||
std::make_pair(content::kDataScheme,
|
||||
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
|
||||
new net::DataProtocolHandler)));
|
||||
protocol_handlers->insert(
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "libcef/common/request_impl.h"
|
||||
#include "libcef/common/response_impl.h"
|
||||
#include "libcef/common/scheme_registration.h"
|
||||
#include "libcef/common/upload_data.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/lazy_instance.h"
|
||||
|
@ -27,7 +28,6 @@
|
|||
#include "base/synchronization/lock.h"
|
||||
#include "net/base/completion_callback.h"
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/http/http_util.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
#include "base/debug/trace_event.h"
|
||||
#include "base/time/time.h"
|
||||
|
||||
bool CefBeginTracing(const CefString& categories) {
|
||||
bool CefBeginTracing(const CefString& categories,
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
if (!CONTEXT_STATE_VALID()) {
|
||||
NOTREACHED() << "context not valid";
|
||||
return false;
|
||||
|
@ -26,11 +27,11 @@ bool CefBeginTracing(const CefString& categories) {
|
|||
if (!subscriber)
|
||||
return false;
|
||||
|
||||
return subscriber->BeginTracing(categories);
|
||||
return subscriber->BeginTracing(categories, callback);
|
||||
}
|
||||
|
||||
bool CefEndTracingAsync(const CefString& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback) {
|
||||
bool CefEndTracing(const CefString& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback) {
|
||||
if (!CONTEXT_STATE_VALID()) {
|
||||
NOTREACHED() << "context not valid";
|
||||
return false;
|
||||
|
@ -45,7 +46,7 @@ bool CefEndTracingAsync(const CefString& tracing_file,
|
|||
if (!subscriber)
|
||||
return false;
|
||||
|
||||
return subscriber->EndTracingAsync(base::FilePath(tracing_file), callback);
|
||||
return subscriber->EndTracing(base::FilePath(tracing_file), callback);
|
||||
}
|
||||
|
||||
int64 CefNowFromSystemTraceTime() {
|
||||
|
|
|
@ -26,7 +26,9 @@ CefTraceSubscriber::~CefTraceSubscriber() {
|
|||
}
|
||||
}
|
||||
|
||||
bool CefTraceSubscriber::BeginTracing(const std::string& categories) {
|
||||
bool CefTraceSubscriber::BeginTracing(
|
||||
const std::string& categories,
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
if (collecting_trace_data_)
|
||||
|
@ -34,13 +36,16 @@ bool CefTraceSubscriber::BeginTracing(const std::string& categories) {
|
|||
|
||||
collecting_trace_data_ = true;
|
||||
|
||||
TracingController::EnableRecordingDoneCallback done_callback;
|
||||
if (callback.get())
|
||||
done_callback = base::Bind(&CefCompletionCallback::OnComplete, callback);
|
||||
|
||||
TracingController::GetInstance()->EnableRecording(
|
||||
categories, TracingController::DEFAULT_OPTIONS,
|
||||
TracingController::EnableRecordingDoneCallback());
|
||||
categories, TracingController::DEFAULT_OPTIONS, done_callback);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CefTraceSubscriber::EndTracingAsync(
|
||||
bool CefTraceSubscriber::EndTracing(
|
||||
const base::FilePath& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
|
|
@ -19,9 +19,10 @@ class CefTraceSubscriber {
|
|||
CefTraceSubscriber();
|
||||
virtual ~CefTraceSubscriber();
|
||||
|
||||
bool BeginTracing(const std::string& categories);
|
||||
bool EndTracingAsync(const base::FilePath& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback);
|
||||
bool BeginTracing(const std::string& categories,
|
||||
CefRefPtr<CefCompletionCallback> callback);
|
||||
bool EndTracing(const base::FilePath& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback);
|
||||
|
||||
private:
|
||||
void OnTracingFileResult(CefRefPtr<CefEndTracingCallback> callback,
|
||||
|
|
|
@ -274,7 +274,7 @@ void CefURLRequestContextGetter::SetCookieStoragePath(
|
|||
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
|
||||
persist_session_cookies,
|
||||
NULL,
|
||||
scoped_ptr<content::CookieCryptoDelegate>());
|
||||
NULL);
|
||||
} else {
|
||||
NOTREACHED() << "The cookie storage directory could not be created";
|
||||
}
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
// IPC messages for CEF.
|
||||
// Multiply-included message file, hence no include guard.
|
||||
|
||||
#include "libcef/common/upload_data.h"
|
||||
|
||||
#include "base/memory/shared_memory.h"
|
||||
#include "base/values.h"
|
||||
#include "content/public/common/common_param_traits.h"
|
||||
#include "content/public/common/referrer.h"
|
||||
#include "ipc/ipc_message_macros.h"
|
||||
#include "net/base/upload_data.h"
|
||||
|
||||
// TODO(cef): Re-using the message start for extensions may be problematic in
|
||||
// the future. It would be better if ipc_message_utils.h contained a value
|
||||
|
|
|
@ -291,6 +291,13 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||
command_line->AppendSwitchASCII(switches::kContextSafetyImplementation,
|
||||
base::IntToString(settings.context_safety_implementation));
|
||||
}
|
||||
|
||||
if (settings.windowless_rendering_enabled) {
|
||||
// Must disable delegated renderer and threaded compositing for select
|
||||
// popups to display correctly in a windowless browser.
|
||||
command_line->AppendSwitch(switches::kDisableDelegatedRenderer);
|
||||
command_line->AppendSwitch(switches::kDisableThreadedCompositing);
|
||||
}
|
||||
}
|
||||
|
||||
if (content_client_.application().get()) {
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
#include "libcef/common/http_header_utils.h"
|
||||
#include "libcef/common/request_impl.h"
|
||||
#include "libcef/common/task_runner_impl.h"
|
||||
#include "libcef/common/upload_data.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "content/public/browser/resource_request_info.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/base/upload_data_stream.h"
|
||||
#include "net/base/upload_element_reader.h"
|
||||
#include "net/base/upload_bytes_element_reader.h"
|
||||
|
|
|
@ -28,7 +28,7 @@ bool IsInternalHandledScheme(const std::string& scheme) {
|
|||
chrome::kBlobScheme,
|
||||
chrome::kChromeDevToolsScheme,
|
||||
chrome::kChromeUIScheme,
|
||||
chrome::kDataScheme,
|
||||
content::kDataScheme,
|
||||
content::kFileScheme,
|
||||
content::kFileSystemScheme,
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ bool IsInternalProtectedScheme(const std::string& scheme) {
|
|||
static const char* schemes[] = {
|
||||
chrome::kBlobScheme,
|
||||
chrome::kChromeUIScheme,
|
||||
chrome::kDataScheme,
|
||||
content::kDataScheme,
|
||||
content::kFileScheme,
|
||||
content::kFileSystemScheme,
|
||||
#if !defined(DISABLE_FTP_SUPPORT)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "cef/libcef/common/upload_data.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace net {
|
||||
|
||||
UploadData::UploadData()
|
||||
: identifier_(0),
|
||||
is_chunked_(false),
|
||||
last_chunk_appended_(false) {
|
||||
}
|
||||
|
||||
void UploadData::AppendBytes(const char* bytes, int bytes_len) {
|
||||
DCHECK(!is_chunked_);
|
||||
if (bytes_len > 0) {
|
||||
elements_.push_back(new UploadElement());
|
||||
elements_.back()->SetToBytes(bytes, bytes_len);
|
||||
}
|
||||
}
|
||||
|
||||
void UploadData::AppendFileRange(const base::FilePath& file_path,
|
||||
uint64 offset, uint64 length,
|
||||
const base::Time& expected_modification_time) {
|
||||
DCHECK(!is_chunked_);
|
||||
elements_.push_back(new UploadElement());
|
||||
elements_.back()->SetToFilePathRange(file_path, offset, length,
|
||||
expected_modification_time);
|
||||
}
|
||||
|
||||
UploadData::~UploadData() {
|
||||
}
|
||||
|
||||
} // namespace net
|
|
@ -0,0 +1,83 @@
|
|||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef CEF_LIBCEF_COMMON_UPLOAD_DATA_H_
|
||||
#define CEF_LIBCEF_COMMON_UPLOAD_DATA_H_
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/scoped_vector.h"
|
||||
#include "base/supports_user_data.h"
|
||||
#include "net/base/net_export.h"
|
||||
#include "net/base/upload_element.h"
|
||||
|
||||
namespace base {
|
||||
class FilePath;
|
||||
class Time;
|
||||
} // namespace base
|
||||
|
||||
namespace net {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// A very concrete class representing the data to be uploaded as part of a
|
||||
// URLRequest.
|
||||
//
|
||||
// Until there is a more abstract class for this, this one derives from
|
||||
// SupportsUserData to allow users to stash random data by
|
||||
// key and ensure its destruction when UploadData is finally deleted.
|
||||
class NET_EXPORT UploadData
|
||||
: public base::RefCounted<UploadData>,
|
||||
public base::SupportsUserData {
|
||||
public:
|
||||
UploadData();
|
||||
|
||||
void AppendBytes(const char* bytes, int bytes_len);
|
||||
|
||||
void AppendFileRange(const base::FilePath& file_path,
|
||||
uint64 offset, uint64 length,
|
||||
const base::Time& expected_modification_time);
|
||||
|
||||
// Initializes the object to send chunks of upload data over time rather
|
||||
// than all at once. Chunked data may only contain bytes, not files.
|
||||
void set_is_chunked(bool set) { is_chunked_ = set; }
|
||||
bool is_chunked() const { return is_chunked_; }
|
||||
|
||||
// set_last_chunk_appended() is only used for serialization.
|
||||
void set_last_chunk_appended(bool set) { last_chunk_appended_ = set; }
|
||||
bool last_chunk_appended() const { return last_chunk_appended_; }
|
||||
|
||||
const ScopedVector<UploadElement>& elements() const {
|
||||
return elements_;
|
||||
}
|
||||
|
||||
ScopedVector<UploadElement>* elements_mutable() {
|
||||
return &elements_;
|
||||
}
|
||||
|
||||
void swap_elements(ScopedVector<UploadElement>* elements) {
|
||||
elements_.swap(*elements);
|
||||
}
|
||||
|
||||
// Identifies a particular upload instance, which is used by the cache to
|
||||
// formulate a cache key. This value should be unique across browser
|
||||
// sessions. A value of 0 is used to indicate an unspecified identifier.
|
||||
void set_identifier(int64 id) { identifier_ = id; }
|
||||
int64 identifier() const { return identifier_; }
|
||||
|
||||
private:
|
||||
friend class base::RefCounted<UploadData>;
|
||||
|
||||
virtual ~UploadData();
|
||||
|
||||
ScopedVector<UploadElement> elements_;
|
||||
int64 identifier_;
|
||||
bool is_chunked_;
|
||||
bool last_chunk_appended_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(UploadData);
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_UPLOAD_DATA_H_
|
|
@ -37,7 +37,6 @@
|
|||
#include "third_party/WebKit/public/web/WebScriptSource.h"
|
||||
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
||||
#include "third_party/WebKit/public/web/WebView.h"
|
||||
#include "webkit/glue/webkit_glue.h"
|
||||
|
||||
using blink::WebFrame;
|
||||
using blink::WebScriptSource;
|
||||
|
|
|
@ -517,7 +517,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
|
|||
}
|
||||
|
||||
bool CefContentRendererClient::HandleNavigation(
|
||||
content::RenderView* view,
|
||||
content::RenderFrame* render_frame,
|
||||
content::DocumentState* document_state,
|
||||
int opener_id,
|
||||
blink::WebFrame* frame,
|
||||
|
|
|
@ -82,7 +82,7 @@ class CefContentRendererClient : public content::ContentRendererClient,
|
|||
blink::WebFrame* frame,
|
||||
const blink::WebPluginParams& params,
|
||||
blink::WebPlugin** plugin) OVERRIDE;
|
||||
virtual bool HandleNavigation(content::RenderView* view,
|
||||
virtual bool HandleNavigation(content::RenderFrame* render_frame,
|
||||
content::DocumentState* document_state,
|
||||
int opener_id,
|
||||
blink::WebFrame* frame,
|
||||
|
|
|
@ -112,8 +112,6 @@ CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() {
|
|||
return DOM_NODE_TYPE_TEXT;
|
||||
case WebNode::CDataSectionNode:
|
||||
return DOM_NODE_TYPE_CDATA_SECTION;
|
||||
case WebNode::EntityNode:
|
||||
return DOM_NODE_TYPE_ENTITY;
|
||||
case WebNode::ProcessingInstructionsNode:
|
||||
return DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS;
|
||||
case WebNode::CommentNode:
|
||||
|
@ -124,10 +122,6 @@ CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() {
|
|||
return DOM_NODE_TYPE_DOCUMENT_TYPE;
|
||||
case WebNode::DocumentFragmentNode:
|
||||
return DOM_NODE_TYPE_DOCUMENT_FRAGMENT;
|
||||
case WebNode::NotationNode:
|
||||
return DOM_NODE_TYPE_NOTATION;
|
||||
case WebNode::XPathNamespaceNode:
|
||||
return DOM_NODE_TYPE_XPATH_NAMESPACE;
|
||||
default:
|
||||
return DOM_NODE_TYPE_UNSUPPORTED;
|
||||
}
|
||||
|
|
|
@ -620,7 +620,7 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
|
|||
}
|
||||
} else {
|
||||
WebCore::WorkerScriptController* controller =
|
||||
WebCore::WorkerScriptController::controllerForContext();
|
||||
WebCore::WorkerScriptController::controllerForContext(isolate);
|
||||
DCHECK(controller);
|
||||
if (controller) {
|
||||
func_rv = WebCore::ScriptController::callFunction(
|
||||
|
@ -1154,7 +1154,7 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
|||
}
|
||||
|
||||
// Create the new V8 object.
|
||||
v8::Local<v8::Object> obj = v8::Object::New();
|
||||
v8::Local<v8::Object> obj = v8::Object::New(isolate);
|
||||
|
||||
// Create a tracker object that will cause the user data and/or accessor
|
||||
// reference to be released when the V8 object is destroyed.
|
||||
|
|
|
@ -124,7 +124,7 @@ class CefV8HandleBase :
|
|||
template <typename v8class>
|
||||
class CefV8Handle : public CefV8HandleBase {
|
||||
public:
|
||||
typedef v8::Handle<v8class> handleType;
|
||||
typedef v8::Local<v8class> handleType;
|
||||
typedef v8::Persistent<v8class> persistentType;
|
||||
|
||||
CefV8Handle(v8::Isolate* isolate,
|
||||
|
@ -275,7 +275,7 @@ class CefV8ValueImpl : public CefV8Value {
|
|||
|
||||
class Handle : public CefV8HandleBase {
|
||||
public:
|
||||
typedef v8::Handle<v8::Value> handleType;
|
||||
typedef v8::Local<v8::Value> handleType;
|
||||
typedef v8::Persistent<v8::Value> persistentType;
|
||||
|
||||
Handle(v8::Isolate* isolate,
|
||||
|
|
|
@ -274,7 +274,7 @@ need to be translated for each locale.-->
|
|||
<message name="IDS_PRINT_SPOOL_FAILED_ERROR_TEXT" desc="Text in a messagebox when printing fails because of printer issues.">
|
||||
Something went wrong when trying to print. Please check your printer and try again.
|
||||
</message>
|
||||
<message name="IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS" desc="Message to display when selected printer is not reachable or its settings are invalid.">
|
||||
<message name="IDS_PRINT_INVALID_PRINTER_SETTINGS" desc="Message to display when selected printer is not reachable or its settings are invalid.">
|
||||
The selected printer is not available or not installed correctly. Check your printer or try selecting another printer.
|
||||
</message>
|
||||
</messages>
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/completion_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK completion_handler_on_complete(
|
||||
struct _cef_completion_handler_t* self) {
|
||||
void CEF_CALLBACK completion_callback_on_complete(
|
||||
struct _cef_completion_callback_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
|
@ -24,21 +24,21 @@ void CEF_CALLBACK completion_handler_on_complete(
|
|||
return;
|
||||
|
||||
// Execute
|
||||
CefCompletionHandlerCppToC::Get(self)->OnComplete();
|
||||
CefCompletionCallbackCppToC::Get(self)->OnComplete();
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefCompletionHandlerCppToC::CefCompletionHandlerCppToC(
|
||||
CefCompletionHandler* cls)
|
||||
: CefCppToC<CefCompletionHandlerCppToC, CefCompletionHandler,
|
||||
cef_completion_handler_t>(cls) {
|
||||
struct_.struct_.on_complete = completion_handler_on_complete;
|
||||
CefCompletionCallbackCppToC::CefCompletionCallbackCppToC(
|
||||
CefCompletionCallback* cls)
|
||||
: CefCppToC<CefCompletionCallbackCppToC, CefCompletionCallback,
|
||||
cef_completion_callback_t>(cls) {
|
||||
struct_.struct_.on_complete = completion_callback_on_complete;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefCompletionHandlerCppToC, CefCompletionHandler,
|
||||
cef_completion_handler_t>::DebugObjCt = 0;
|
||||
template<> long CefCppToC<CefCompletionCallbackCppToC, CefCompletionCallback,
|
||||
cef_completion_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_HANDLER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_COMPLETION_HANDLER_CPPTOC_H_
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
|
@ -24,14 +24,14 @@
|
|||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefCompletionHandlerCppToC
|
||||
: public CefCppToC<CefCompletionHandlerCppToC, CefCompletionHandler,
|
||||
cef_completion_handler_t> {
|
||||
class CefCompletionCallbackCppToC
|
||||
: public CefCppToC<CefCompletionCallbackCppToC, CefCompletionCallback,
|
||||
cef_completion_callback_t> {
|
||||
public:
|
||||
explicit CefCompletionHandlerCppToC(CefCompletionHandler* cls);
|
||||
virtual ~CefCompletionHandlerCppToC() {}
|
||||
explicit CefCompletionCallbackCppToC(CefCompletionCallback* cls);
|
||||
virtual ~CefCompletionCallbackCppToC() {}
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_COMPLETION_HANDLER_CPPTOC_H_
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/completion_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
@ -184,17 +184,20 @@ int CEF_CALLBACK cookie_manager_set_storage_path(
|
|||
}
|
||||
|
||||
int CEF_CALLBACK cookie_manager_flush_store(struct _cef_cookie_manager_t* self,
|
||||
cef_completion_handler_t* handler) {
|
||||
cef_completion_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Unverified params: handler
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefCookieManagerCppToC::Get(self)->FlushStore(
|
||||
CefCompletionHandlerCToCpp::Wrap(handler));
|
||||
CefCompletionCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/completion_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefCompletionHandlerCToCpp::OnComplete() {
|
||||
void CefCompletionCallbackCToCpp::OnComplete() {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_complete))
|
||||
return;
|
||||
|
||||
|
@ -27,7 +27,7 @@ void CefCompletionHandlerCToCpp::OnComplete() {
|
|||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefCompletionHandlerCToCpp, CefCompletionHandler,
|
||||
cef_completion_handler_t>::DebugObjCt = 0;
|
||||
template<> long CefCToCpp<CefCompletionCallbackCToCpp, CefCompletionCallback,
|
||||
cef_completion_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMPLETION_HANDLER_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_COMPLETION_HANDLER_CTOCPP_H_
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
|
@ -24,19 +24,19 @@
|
|||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefCompletionHandlerCToCpp
|
||||
: public CefCToCpp<CefCompletionHandlerCToCpp, CefCompletionHandler,
|
||||
cef_completion_handler_t> {
|
||||
class CefCompletionCallbackCToCpp
|
||||
: public CefCToCpp<CefCompletionCallbackCToCpp, CefCompletionCallback,
|
||||
cef_completion_callback_t> {
|
||||
public:
|
||||
explicit CefCompletionHandlerCToCpp(cef_completion_handler_t* str)
|
||||
: CefCToCpp<CefCompletionHandlerCToCpp, CefCompletionHandler,
|
||||
cef_completion_handler_t>(str) {}
|
||||
virtual ~CefCompletionHandlerCToCpp() {}
|
||||
explicit CefCompletionCallbackCToCpp(cef_completion_callback_t* str)
|
||||
: CefCToCpp<CefCompletionCallbackCToCpp, CefCompletionCallback,
|
||||
cef_completion_callback_t>(str) {}
|
||||
virtual ~CefCompletionCallbackCToCpp() {}
|
||||
|
||||
// CefCompletionHandler methods
|
||||
// CefCompletionCallback methods
|
||||
virtual void OnComplete() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_COMPLETION_HANDLER_CTOCPP_H_
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/completion_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
@ -172,17 +172,20 @@ bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path,
|
|||
}
|
||||
|
||||
bool CefCookieManagerCToCpp::FlushStore(
|
||||
CefRefPtr<CefCompletionHandler> handler) {
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
if (CEF_MEMBER_MISSING(struct_, flush_store))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: handler
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback.get());
|
||||
if (!callback.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->flush_store(struct_,
|
||||
CefCompletionHandlerCppToC::Wrap(handler));
|
||||
CefCompletionCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
|
|
|
@ -46,7 +46,7 @@ class CefCookieManagerCToCpp
|
|||
const CefString& cookie_name) OVERRIDE;
|
||||
virtual bool SetStoragePath(const CefString& path,
|
||||
bool persist_session_cookies) OVERRIDE;
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionHandler> handler) OVERRIDE;
|
||||
virtual bool FlushStore(CefRefPtr<CefCompletionCallback> callback) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
#include "libcef_dll/cpptoc/zip_reader_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/app_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/completion_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/domevent_listener_ctocpp.h"
|
||||
|
@ -184,7 +184,7 @@ CEF_EXPORT void cef_shutdown() {
|
|||
DCHECK_EQ(CefBrowserHostCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefBrowserProcessHandlerCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCallbackCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCompletionHandlerCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCompletionCallbackCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefContextMenuHandlerCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefContextMenuParamsCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCookieVisitorCToCpp::DebugObjCt, 0);
|
||||
|
@ -472,27 +472,33 @@ CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,
|
|||
return _retval;
|
||||
}
|
||||
|
||||
CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories) {
|
||||
CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories,
|
||||
struct _cef_completion_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
// Unverified params: categories
|
||||
|
||||
// Execute
|
||||
bool _retval = CefBeginTracing(
|
||||
CefString(categories));
|
||||
CefString(categories),
|
||||
CefCompletionCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CEF_EXPORT int cef_end_tracing_async(const cef_string_t* tracing_file,
|
||||
CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file,
|
||||
struct _cef_end_tracing_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: tracing_file, callback
|
||||
|
||||
// Execute
|
||||
bool _retval = CefEndTracingAsync(
|
||||
bool _retval = CefEndTracing(
|
||||
CefString(tracing_file),
|
||||
CefEndTracingCallbackCToCpp::Wrap(callback));
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "include/cef_version.h"
|
||||
#include "libcef_dll/cpptoc/app_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/completion_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
|
||||
|
@ -176,7 +176,7 @@ CEF_GLOBAL void CefShutdown() {
|
|||
DCHECK_EQ(CefBrowserHostCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefBrowserProcessHandlerCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCallbackCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCompletionHandlerCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCompletionCallbackCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefContextMenuHandlerCppToC::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefContextMenuParamsCToCpp::DebugObjCt, 0);
|
||||
DCHECK_EQ(CefCookieVisitorCppToC::DebugObjCt, 0);
|
||||
|
@ -455,27 +455,33 @@ CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId,
|
|||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CEF_GLOBAL bool CefBeginTracing(const CefString& categories) {
|
||||
CEF_GLOBAL bool CefBeginTracing(const CefString& categories,
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback.get());
|
||||
if (!callback.get())
|
||||
return false;
|
||||
// Unverified params: categories
|
||||
|
||||
// Execute
|
||||
int _retval = cef_begin_tracing(
|
||||
categories.GetStruct());
|
||||
categories.GetStruct(),
|
||||
CefCompletionCallbackCppToC::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CEF_GLOBAL bool CefEndTracingAsync(const CefString& tracing_file,
|
||||
CEF_GLOBAL bool CefEndTracing(const CefString& tracing_file,
|
||||
CefRefPtr<CefEndTracingCallback> callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: tracing_file, callback
|
||||
|
||||
// Execute
|
||||
int _retval = cef_end_tracing_async(
|
||||
int _retval = cef_end_tracing(
|
||||
tracing_file.GetStruct(),
|
||||
CefEndTracingCallbackCppToC::Wrap(callback));
|
||||
|
||||
|
|
|
@ -15,10 +15,7 @@ patches = [
|
|||
# Fix Xcode 4 build on OS X Lion.
|
||||
# http://codereview.chromium.org/8086022/
|
||||
#
|
||||
# Set use_default_render_theme=0 to use native-styled scrollbars with aura.
|
||||
# Needs to be set here because setting the value in cef.gypi isn't picked up
|
||||
# by third_party/WebKit/Source/build/features.gypi.
|
||||
# https://code.google.com/p/chromiumembedded/issues/detail?id=180
|
||||
# Don't use aura on Linux.
|
||||
'name': 'build',
|
||||
'path': '../build/',
|
||||
},
|
||||
|
@ -63,32 +60,24 @@ patches = [
|
|||
'name': 'views_widget_180',
|
||||
'path': '../ui/views/widget/',
|
||||
},
|
||||
{
|
||||
# Use native-styled scrollbars with aura on Windows.
|
||||
# https://code.google.com/p/chromiumembedded/issues/detail?id=180
|
||||
'name': 'native_theme_180',
|
||||
'path': '../ui/native_theme/',
|
||||
},
|
||||
{
|
||||
# Allow continued use of ContentRendererClient::HandleNavigation.
|
||||
# https://code.google.com/p/chromiumembedded/issues/detail?id=1129
|
||||
'name': 'content_nav_1129',
|
||||
'path': '../content/',
|
||||
},
|
||||
{
|
||||
# Fix TracingController to properly track response callbacks when a
|
||||
# TraceMessageFilter is removed before a response is received from
|
||||
# the associated subprocess.
|
||||
# https://code.google.com/p/chromiumembedded/issues/detail?id=1157
|
||||
'name': 'tracing_1157',
|
||||
'path': '../content/browser/tracing/',
|
||||
},
|
||||
{
|
||||
# Allow customization of the background color on OS X.
|
||||
# http://code.google.com/p/chromiumembedded/issues/detail?id=1161
|
||||
'name': 'renderer_host_1161',
|
||||
'path': '../content/browser/renderer_host/',
|
||||
},
|
||||
{
|
||||
# Pass RenderFrameHost to WebContentsDelegate::HandleContextMenu.
|
||||
# https://codereview.chromium.org/148843003/
|
||||
'name': 'web_contents_304341',
|
||||
'path': '../content/',
|
||||
},
|
||||
{
|
||||
# Disable scollbar bounce and overlay on OS X.
|
||||
# http://code.google.com/p/chromiumembedded/issues/detail?id=364
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Index: common.gypi
|
||||
===================================================================
|
||||
--- common.gypi (revision 240657)
|
||||
--- common.gypi (revision 248478)
|
||||
+++ common.gypi (working copy)
|
||||
@@ -9,6 +9,9 @@
|
||||
# Variables expected to be overriden on the GYP command line (-D) or by
|
||||
|
@ -12,18 +12,22 @@ Index: common.gypi
|
|||
# Putting a variables dict inside another variables dict looks kind of
|
||||
# weird. This is done so that 'host_arch', 'chromeos', etc are defined as
|
||||
# variables within the outer variables dict here. This is necessary
|
||||
@@ -201,7 +204,7 @@
|
||||
'enable_app_list%': 0,
|
||||
}],
|
||||
@@ -88,9 +91,9 @@
|
||||
#
|
||||
# TODO(erg): Merge this into the previous block once compiling with
|
||||
# aura safely implies including ash capabilities.
|
||||
- ['OS=="linux"', {
|
||||
- 'use_aura%': 1,
|
||||
- }],
|
||||
+ #['OS=="linux"', {
|
||||
+ # 'use_aura%': 1,
|
||||
+ #}],
|
||||
|
||||
- ['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
|
||||
+ ['OS!="win" and OS!="mac" and OS!="ios" and OS!="android"', {
|
||||
'use_default_render_theme%': 1,
|
||||
}, {
|
||||
'use_default_render_theme%': 0,
|
||||
# Whether we're a traditional desktop unix.
|
||||
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
|
||||
Index: mac/strip_save_dsym
|
||||
===================================================================
|
||||
--- mac/strip_save_dsym (revision 240657)
|
||||
--- mac/strip_save_dsym (revision 248478)
|
||||
+++ mac/strip_save_dsym (working copy)
|
||||
@@ -48,7 +48,7 @@
|
||||
"bundle"]
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
Index: public/renderer/content_renderer_client.cc
|
||||
===================================================================
|
||||
--- public/renderer/content_renderer_client.cc (revision 242756)
|
||||
--- public/renderer/content_renderer_client.cc (revision 248478)
|
||||
+++ public/renderer/content_renderer_client.cc (working copy)
|
||||
@@ -91,7 +91,6 @@
|
||||
@@ -92,7 +92,6 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
-#ifdef OS_ANDROID
|
||||
bool ContentRendererClient::HandleNavigation(
|
||||
RenderView* view,
|
||||
RenderFrame* render_frame,
|
||||
DocumentState* document_state,
|
||||
@@ -103,7 +102,6 @@
|
||||
@@ -104,7 +103,6 @@
|
||||
bool is_redirect) {
|
||||
return false;
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ Index: public/renderer/content_renderer_client.cc
|
|||
const GURL& url,
|
||||
Index: public/renderer/content_renderer_client.h
|
||||
===================================================================
|
||||
--- public/renderer/content_renderer_client.h (revision 242756)
|
||||
--- public/renderer/content_renderer_client.h (revision 248478)
|
||||
+++ public/renderer/content_renderer_client.h (working copy)
|
||||
@@ -172,7 +172,6 @@
|
||||
@@ -175,7 +175,6 @@
|
||||
// Returns true if a popup window should be allowed.
|
||||
virtual bool AllowPopup();
|
||||
|
||||
|
@ -30,7 +30,7 @@ Index: public/renderer/content_renderer_client.h
|
|||
// TODO(sgurun) This callback is deprecated and will be removed as soon
|
||||
// as android webview completes implementation of a resource throttle based
|
||||
// shouldoverrideurl implementation. See crbug.com/325351
|
||||
@@ -187,7 +186,6 @@
|
||||
@@ -190,7 +189,6 @@
|
||||
blink::WebNavigationType type,
|
||||
blink::WebNavigationPolicy default_policy,
|
||||
bool is_redirect);
|
||||
|
@ -40,17 +40,17 @@ Index: public/renderer/content_renderer_client.h
|
|||
// If |send_referrer| is set to false (which is the default), no referrer
|
||||
Index: renderer/render_view_impl.cc
|
||||
===================================================================
|
||||
--- renderer/render_view_impl.cc (revision 242756)
|
||||
--- renderer/render_view_impl.cc (revision 248478)
|
||||
+++ renderer/render_view_impl.cc (working copy)
|
||||
@@ -3124,7 +3124,6 @@
|
||||
WebFrame* frame, WebDataSource::ExtraData* extraData,
|
||||
const WebURLRequest& request, WebNavigationType type,
|
||||
WebNavigationPolicy default_policy, bool is_redirect) {
|
||||
@@ -3071,7 +3071,6 @@
|
||||
WebDataSource::ExtraData* extraData, const WebURLRequest& request,
|
||||
WebNavigationType type, WebNavigationPolicy default_policy,
|
||||
bool is_redirect) {
|
||||
-#ifdef OS_ANDROID
|
||||
// The handlenavigation API is deprecated and will be removed once
|
||||
// crbug.com/325351 is resolved.
|
||||
if (request.url() != GURL(kSwappedOutURL) &&
|
||||
@@ -3139,7 +3138,6 @@
|
||||
@@ -3086,7 +3085,6 @@
|
||||
is_redirect)) {
|
||||
return blink::WebNavigationPolicyIgnore;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Index: message_loop.cc
|
||||
===================================================================
|
||||
--- message_loop.cc (revision 237081)
|
||||
--- message_loop.cc (revision 248478)
|
||||
+++ message_loop.cc (working copy)
|
||||
@@ -166,7 +166,7 @@
|
||||
@@ -142,7 +142,7 @@
|
||||
MessageLoop::~MessageLoop() {
|
||||
DCHECK_EQ(this, current());
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
Index: native_theme_aura.cc
|
||||
===================================================================
|
||||
--- native_theme_aura.cc (revision 237081)
|
||||
+++ native_theme_aura.cc (working copy)
|
||||
@@ -17,10 +17,12 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
+#if !defined(OS_WIN)
|
||||
// static
|
||||
NativeTheme* NativeTheme::instance() {
|
||||
return NativeThemeAura::instance();
|
||||
}
|
||||
+#endif
|
||||
|
||||
// static
|
||||
NativeThemeAura* NativeThemeAura::instance() {
|
||||
Index: native_theme_win.cc
|
||||
===================================================================
|
||||
--- native_theme_win.cc (revision 237081)
|
||||
+++ native_theme_win.cc (working copy)
|
||||
@@ -211,12 +211,10 @@
|
||||
// TODO(sky): seems like we should default to NativeThemeWin, but that currently
|
||||
// breaks a couple of tests (FocusTraversalTest.NormalTraversal in
|
||||
// views_unittests).
|
||||
-#if !defined(USE_AURA)
|
||||
// static
|
||||
NativeTheme* NativeTheme::instance() {
|
||||
return NativeThemeWin::instance();
|
||||
}
|
||||
-#endif
|
||||
|
||||
// static
|
||||
NativeThemeWin* NativeThemeWin::instance() {
|
|
@ -1,8 +1,21 @@
|
|||
Index: compositing_iosurface_layer_mac.mm
|
||||
===================================================================
|
||||
--- compositing_iosurface_layer_mac.mm (revision 248478)
|
||||
+++ compositing_iosurface_layer_mac.mm (working copy)
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
if (!context_.get() || !renderWidgetHostView_ ||
|
||||
!renderWidgetHostView_->compositing_iosurface_) {
|
||||
- glClearColor(1, 1, 1, 1);
|
||||
+ glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
return;
|
||||
}
|
||||
Index: compositing_iosurface_mac.mm
|
||||
===================================================================
|
||||
--- compositing_iosurface_mac.mm (revision 242756)
|
||||
--- compositing_iosurface_mac.mm (revision 248478)
|
||||
+++ compositing_iosurface_mac.mm (working copy)
|
||||
@@ -433,7 +433,7 @@
|
||||
@@ -424,7 +424,7 @@
|
||||
glUseProgram(0); CHECK_AND_SAVE_GL_ERROR();
|
||||
} else {
|
||||
// Should match the clear color of RenderWidgetHostViewMac.
|
||||
|
@ -11,10 +24,9 @@ Index: compositing_iosurface_mac.mm
|
|||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
|
||||
Index: compositing_iosurface_shader_programs_mac.cc
|
||||
===================================================================
|
||||
--- compositing_iosurface_shader_programs_mac.cc (revision 242756)
|
||||
--- compositing_iosurface_shader_programs_mac.cc (revision 248478)
|
||||
+++ compositing_iosurface_shader_programs_mac.cc (working copy)
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/debug/trace_event.h"
|
||||
|
@ -49,7 +61,7 @@ Index: compositing_iosurface_shader_programs_mac.cc
|
|||
// Select and compile the shader program source code.
|
||||
if (shader_type == GL_VERTEX_SHADER) {
|
||||
const GLchar* source_snippets[] = {
|
||||
@@ -414,6 +426,14 @@
|
||||
@@ -412,6 +424,14 @@
|
||||
Reset();
|
||||
}
|
||||
|
||||
|
@ -66,7 +78,7 @@ Index: compositing_iosurface_shader_programs_mac.cc
|
|||
shader_programs_[which] =
|
||||
Index: compositing_iosurface_shader_programs_mac.h
|
||||
===================================================================
|
||||
--- compositing_iosurface_shader_programs_mac.h (revision 242756)
|
||||
--- compositing_iosurface_shader_programs_mac.h (revision 248478)
|
||||
+++ compositing_iosurface_shader_programs_mac.h (working copy)
|
||||
@@ -48,6 +48,8 @@
|
||||
return rgb_to_yv12_output_format_;
|
||||
|
@ -77,26 +89,11 @@ Index: compositing_iosurface_shader_programs_mac.h
|
|||
protected:
|
||||
FRIEND_TEST_ALL_PREFIXES(CompositingIOSurfaceTransformerTest,
|
||||
TransformsRGBToYV12);
|
||||
|
||||
Index: compositing_iosurface_layer_mac.mm
|
||||
===================================================================
|
||||
--- compositing_iosurface_layer_mac.mm (revision 242756)
|
||||
+++ compositing_iosurface_layer_mac.mm (working copy)
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
if (!context_.get() || !renderWidgetHostView_ ||
|
||||
!renderWidgetHostView_->compositing_iosurface_) {
|
||||
- glClearColor(1, 1, 1, 1);
|
||||
+ glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
return;
|
||||
}
|
||||
|
||||
Index: render_widget_host_view_mac.mm
|
||||
===================================================================
|
||||
--- render_widget_host_view_mac.mm (revision 242756)
|
||||
--- render_widget_host_view_mac.mm (revision 248478)
|
||||
+++ render_widget_host_view_mac.mm (working copy)
|
||||
@@ -490,7 +490,7 @@
|
||||
@@ -494,7 +494,7 @@
|
||||
software_layer_.reset([[CALayer alloc] init]);
|
||||
if (!software_layer_)
|
||||
LOG(ERROR) << "Failed to create CALayer for software rendering";
|
||||
|
@ -105,7 +102,7 @@ Index: render_widget_host_view_mac.mm
|
|||
[software_layer_ setDelegate:cocoa_view_];
|
||||
[software_layer_ setContentsGravity:kCAGravityTopLeft];
|
||||
[software_layer_ setFrame:NSRectToCGRect([cocoa_view_ bounds])];
|
||||
@@ -2737,7 +2737,7 @@
|
||||
@@ -2846,7 +2846,7 @@
|
||||
|
||||
NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)];
|
||||
CGContextSetFillColorWithColor(context,
|
||||
|
@ -114,7 +111,7 @@ Index: render_widget_host_view_mac.mm
|
|||
CGContextFillRect(context, NSRectToCGRect(r));
|
||||
}
|
||||
if (damagedRect.bottom() > rect.bottom()) {
|
||||
@@ -2759,7 +2759,7 @@
|
||||
@@ -2868,7 +2868,7 @@
|
||||
|
||||
NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)];
|
||||
CGContextSetFillColorWithColor(context,
|
||||
|
@ -123,7 +120,7 @@ Index: render_widget_host_view_mac.mm
|
|||
CGContextFillRect(context, NSRectToCGRect(r));
|
||||
}
|
||||
}
|
||||
@@ -2918,7 +2918,7 @@
|
||||
@@ -3029,7 +3029,7 @@
|
||||
}
|
||||
} else {
|
||||
CGContextSetFillColorWithColor(context,
|
||||
|
@ -132,7 +129,7 @@ Index: render_widget_host_view_mac.mm
|
|||
CGContextFillRect(context, dirtyRect);
|
||||
if (renderWidgetHostView_->whiteout_start_time_.is_null())
|
||||
renderWidgetHostView_->whiteout_start_time_ = base::TimeTicks::Now();
|
||||
@@ -3925,7 +3925,7 @@
|
||||
@@ -4037,7 +4037,7 @@
|
||||
if (!renderWidgetHostView_->render_widget_host_ ||
|
||||
renderWidgetHostView_->render_widget_host_->is_hidden()) {
|
||||
CGContextSetFillColorWithColor(context,
|
||||
|
@ -141,4 +138,3 @@ Index: render_widget_host_view_mac.mm
|
|||
CGContextFillRect(context, clipRect);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Index: core/frame/FrameView.cpp
|
||||
===================================================================
|
||||
--- core/frame/FrameView.cpp (revision 163979)
|
||||
--- core/frame/FrameView.cpp (revision 166298)
|
||||
+++ core/frame/FrameView.cpp (working copy)
|
||||
@@ -200,8 +200,10 @@
|
||||
@@ -168,8 +168,10 @@
|
||||
if (!isMainFrame())
|
||||
return;
|
||||
|
||||
|
@ -13,13 +13,13 @@ Index: core/frame/FrameView.cpp
|
|||
}
|
||||
|
||||
PassRefPtr<FrameView> FrameView::create(Frame* frame)
|
||||
Index: platform/mac/NSScrollerImpDetails.mm
|
||||
Index: platform/scroll/ScrollbarThemeMacCommon.mm
|
||||
===================================================================
|
||||
--- platform/mac/NSScrollerImpDetails.mm (revision 163979)
|
||||
+++ platform/mac/NSScrollerImpDetails.mm (working copy)
|
||||
@@ -73,10 +73,14 @@
|
||||
|
||||
bool isScrollbarOverlayAPIAvailable()
|
||||
--- platform/scroll/ScrollbarThemeMacCommon.mm (revision 166298)
|
||||
+++ platform/scroll/ScrollbarThemeMacCommon.mm (working copy)
|
||||
@@ -369,10 +369,14 @@
|
||||
// static
|
||||
bool ScrollbarThemeMacCommon::isOverlayAPIAvailable()
|
||||
{
|
||||
+#if 0
|
||||
static bool apiAvailable =
|
||||
|
@ -31,4 +31,4 @@ Index: platform/mac/NSScrollerImpDetails.mm
|
|||
+#endif
|
||||
}
|
||||
|
||||
NSScrollerStyle recommendedScrollerStyle()
|
||||
} // namespace WebCore
|
||||
|
|
|
@ -1,332 +0,0 @@
|
|||
Index: trace_message_filter.cc
|
||||
===================================================================
|
||||
--- trace_message_filter.cc (revision 241258)
|
||||
+++ trace_message_filter.cc (working copy)
|
||||
@@ -121,7 +121,7 @@
|
||||
if (is_awaiting_end_ack_) {
|
||||
is_awaiting_end_ack_ = false;
|
||||
TracingControllerImpl::GetInstance()->OnDisableRecordingAcked(
|
||||
- known_categories);
|
||||
+ this, known_categories);
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -132,7 +132,8 @@
|
||||
// but check in case the child process is compromised.
|
||||
if (is_awaiting_capture_monitoring_snapshot_ack_) {
|
||||
is_awaiting_capture_monitoring_snapshot_ack_ = false;
|
||||
- TracingControllerImpl::GetInstance()->OnCaptureMonitoringSnapshotAcked();
|
||||
+ TracingControllerImpl::GetInstance()->OnCaptureMonitoringSnapshotAcked(
|
||||
+ this);
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -160,7 +161,7 @@
|
||||
if (is_awaiting_buffer_percent_full_ack_) {
|
||||
is_awaiting_buffer_percent_full_ack_ = false;
|
||||
TracingControllerImpl::GetInstance()->OnTraceBufferPercentFullReply(
|
||||
- percent_full);
|
||||
+ this, percent_full);
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
Index: tracing_controller_impl.cc
|
||||
===================================================================
|
||||
--- tracing_controller_impl.cc (revision 241258)
|
||||
+++ tracing_controller_impl.cc (working copy)
|
||||
@@ -177,7 +177,7 @@
|
||||
is_recording_ = true;
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendBeginTracing(category_filter, trace_options);
|
||||
}
|
||||
@@ -212,6 +212,7 @@
|
||||
// Count myself (local trace) in pending_disable_recording_ack_count_,
|
||||
// acked below.
|
||||
pending_disable_recording_ack_count_ = trace_message_filters_.size() + 1;
|
||||
+ pending_disable_recording_filters_ = trace_message_filters_;
|
||||
|
||||
// Handle special case of zero child processes by immediately flushing the
|
||||
// trace log. Once the flush has completed the caller will be notified that
|
||||
@@ -224,7 +225,7 @@
|
||||
}
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendEndTracing();
|
||||
}
|
||||
@@ -254,7 +255,7 @@
|
||||
static_cast<TraceLog::Options>(monitoring_tracing_options));
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendEnableMonitoring(category_filter,
|
||||
static_cast<TraceLog::Options>(monitoring_tracing_options));
|
||||
@@ -276,7 +277,7 @@
|
||||
TraceLog::GetInstance()->SetDisabled();
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendDisableMonitoring();
|
||||
}
|
||||
@@ -311,6 +312,7 @@
|
||||
// acked below.
|
||||
pending_capture_monitoring_snapshot_ack_count_ =
|
||||
trace_message_filters_.size() + 1;
|
||||
+ pending_capture_monitoring_filters_ = trace_message_filters_;
|
||||
|
||||
// Handle special case of zero child processes by immediately flushing the
|
||||
// trace log. Once the flush has completed the caller will be notified that
|
||||
@@ -323,7 +325,7 @@
|
||||
}
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendCaptureMonitoringSnapshot();
|
||||
}
|
||||
@@ -347,6 +349,7 @@
|
||||
// Count myself in pending_trace_buffer_percent_full_ack_count_, acked below.
|
||||
pending_trace_buffer_percent_full_ack_count_ =
|
||||
trace_message_filters_.size() + 1;
|
||||
+ pending_trace_buffer_percent_full_filters_ = trace_message_filters_;
|
||||
maximum_trace_buffer_percent_full_ = 0;
|
||||
|
||||
// Handle special case of zero child processes.
|
||||
@@ -354,11 +357,12 @@
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply,
|
||||
base::Unretained(this),
|
||||
+ scoped_refptr<TraceMessageFilter>(),
|
||||
TraceLog::GetInstance()->GetBufferPercentFull()));
|
||||
}
|
||||
|
||||
// Notify all child processes.
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendGetTraceBufferPercentFull();
|
||||
}
|
||||
@@ -383,7 +387,7 @@
|
||||
base::Bind(&TracingControllerImpl::OnWatchEventMatched,
|
||||
base::Unretained(this)));
|
||||
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendSetWatchEvent(category_name, event_name);
|
||||
}
|
||||
@@ -396,7 +400,7 @@
|
||||
if (!can_cancel_watch_event())
|
||||
return false;
|
||||
|
||||
- for (TraceMessageFilterMap::iterator it = trace_message_filters_.begin();
|
||||
+ for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin();
|
||||
it != trace_message_filters_.end(); ++it) {
|
||||
it->get()->SendCancelWatchEvent();
|
||||
}
|
||||
@@ -437,15 +441,54 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ // If a filter is removed while a response from that filter is pending then
|
||||
+ // simulate the response. Otherwise the response count will be wrong and the
|
||||
+ // completion callback will never be executed.
|
||||
+ if (pending_disable_recording_ack_count_ > 0) {
|
||||
+ TraceMessageFilterSet::const_iterator it =
|
||||
+ pending_disable_recording_filters_.find(trace_message_filter);
|
||||
+ if (it != pending_disable_recording_filters_.end()) {
|
||||
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
+ base::Bind(&TracingControllerImpl::OnDisableRecordingAcked,
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter),
|
||||
+ std::vector<std::string>()));
|
||||
+ }
|
||||
+ }
|
||||
+ if (pending_capture_monitoring_snapshot_ack_count_ > 0) {
|
||||
+ TraceMessageFilterSet::const_iterator it =
|
||||
+ pending_capture_monitoring_filters_.find(trace_message_filter);
|
||||
+ if (it != pending_capture_monitoring_filters_.end()) {
|
||||
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
+ base::Bind(&TracingControllerImpl::OnCaptureMonitoringSnapshotAcked,
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter)));
|
||||
+ }
|
||||
+ }
|
||||
+ if (pending_trace_buffer_percent_full_ack_count_ > 0) {
|
||||
+ TraceMessageFilterSet::const_iterator it =
|
||||
+ pending_trace_buffer_percent_full_filters_.find(trace_message_filter);
|
||||
+ if (it != pending_trace_buffer_percent_full_filters_.end()) {
|
||||
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
+ base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply,
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter),
|
||||
+ 0));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
trace_message_filters_.erase(trace_message_filter);
|
||||
}
|
||||
|
||||
void TracingControllerImpl::OnDisableRecordingAcked(
|
||||
+ TraceMessageFilter* trace_message_filter,
|
||||
const std::vector<std::string>& known_category_groups) {
|
||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&TracingControllerImpl::OnDisableRecordingAcked,
|
||||
- base::Unretained(this), known_category_groups));
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter),
|
||||
+ known_category_groups));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -456,6 +499,12 @@
|
||||
if (pending_disable_recording_ack_count_ == 0)
|
||||
return;
|
||||
|
||||
+ if (trace_message_filter &&
|
||||
+ !pending_disable_recording_filters_.erase(trace_message_filter)) {
|
||||
+ // The response from the specified message filter has already been received.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (--pending_disable_recording_ack_count_ == 1) {
|
||||
// All acks from subprocesses have been received. Now flush the local trace.
|
||||
// During or after this call, our OnLocalTraceDataCollected will be
|
||||
@@ -497,17 +546,25 @@
|
||||
result_file_.reset();
|
||||
}
|
||||
|
||||
-void TracingControllerImpl::OnCaptureMonitoringSnapshotAcked() {
|
||||
+void TracingControllerImpl::OnCaptureMonitoringSnapshotAcked(
|
||||
+ TraceMessageFilter* trace_message_filter) {
|
||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&TracingControllerImpl::OnCaptureMonitoringSnapshotAcked,
|
||||
- base::Unretained(this)));
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (pending_capture_monitoring_snapshot_ack_count_ == 0)
|
||||
return;
|
||||
|
||||
+ if (trace_message_filter &&
|
||||
+ !pending_capture_monitoring_filters_.erase(trace_message_filter)) {
|
||||
+ // The response from the specified message filter has already been received.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (--pending_capture_monitoring_snapshot_ack_count_ == 1) {
|
||||
// All acks from subprocesses have been received. Now flush the local trace.
|
||||
// During or after this call, our OnLocalMonitoringTraceDataCollected
|
||||
@@ -582,7 +639,7 @@
|
||||
// Simulate an DisableRecordingAcked for the local trace.
|
||||
std::vector<std::string> category_groups;
|
||||
TraceLog::GetInstance()->GetKnownCategoryGroups(&category_groups);
|
||||
- OnDisableRecordingAcked(category_groups);
|
||||
+ OnDisableRecordingAcked(NULL, category_groups);
|
||||
}
|
||||
|
||||
void TracingControllerImpl::OnLocalMonitoringTraceDataCollected(
|
||||
@@ -595,20 +652,30 @@
|
||||
return;
|
||||
|
||||
// Simulate an CaptureMonitoringSnapshotAcked for the local trace.
|
||||
- OnCaptureMonitoringSnapshotAcked();
|
||||
+ OnCaptureMonitoringSnapshotAcked(NULL);
|
||||
}
|
||||
|
||||
-void TracingControllerImpl::OnTraceBufferPercentFullReply(float percent_full) {
|
||||
+void TracingControllerImpl::OnTraceBufferPercentFullReply(
|
||||
+ TraceMessageFilter* trace_message_filter,
|
||||
+ float percent_full) {
|
||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply,
|
||||
- base::Unretained(this), percent_full));
|
||||
+ base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter),
|
||||
+ percent_full));
|
||||
return;
|
||||
}
|
||||
|
||||
if (pending_trace_buffer_percent_full_ack_count_ == 0)
|
||||
return;
|
||||
|
||||
+ if (trace_message_filter &&
|
||||
+ !pending_trace_buffer_percent_full_filters_.erase(trace_message_filter)) {
|
||||
+ // The response from the specified message filter has already been received.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
maximum_trace_buffer_percent_full_ =
|
||||
std::max(maximum_trace_buffer_percent_full_, percent_full);
|
||||
|
||||
@@ -625,6 +692,7 @@
|
||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&TracingControllerImpl::OnTraceBufferPercentFullReply,
|
||||
base::Unretained(this),
|
||||
+ make_scoped_refptr(trace_message_filter),
|
||||
TraceLog::GetInstance()->GetBufferPercentFull()));
|
||||
}
|
||||
}
|
||||
Index: tracing_controller_impl.h
|
||||
===================================================================
|
||||
--- tracing_controller_impl.h (revision 241258)
|
||||
+++ tracing_controller_impl.h (working copy)
|
||||
@@ -55,7 +55,7 @@
|
||||
virtual bool CancelWatchEvent() OVERRIDE;
|
||||
|
||||
private:
|
||||
- typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterMap;
|
||||
+ typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet;
|
||||
class ResultFile;
|
||||
|
||||
friend struct base::DefaultLazyInstanceTraits<TracingControllerImpl>;
|
||||
@@ -107,23 +107,30 @@
|
||||
bool has_more_events);
|
||||
|
||||
void OnDisableRecordingAcked(
|
||||
+ TraceMessageFilter* trace_message_filter,
|
||||
const std::vector<std::string>& known_category_groups);
|
||||
void OnResultFileClosed();
|
||||
|
||||
- void OnCaptureMonitoringSnapshotAcked();
|
||||
+ void OnCaptureMonitoringSnapshotAcked(
|
||||
+ TraceMessageFilter* trace_message_filter);
|
||||
void OnMonitoringSnapshotFileClosed();
|
||||
|
||||
- void OnTraceBufferPercentFullReply(float percent_full);
|
||||
+ void OnTraceBufferPercentFullReply(
|
||||
+ TraceMessageFilter* trace_message_filter,
|
||||
+ float percent_full);
|
||||
|
||||
void OnWatchEventMatched();
|
||||
|
||||
- TraceMessageFilterMap trace_message_filters_;
|
||||
+ TraceMessageFilterSet trace_message_filters_;
|
||||
// Pending acks for DisableRecording.
|
||||
int pending_disable_recording_ack_count_;
|
||||
+ TraceMessageFilterSet pending_disable_recording_filters_;
|
||||
// Pending acks for CaptureMonitoringSnapshot.
|
||||
int pending_capture_monitoring_snapshot_ack_count_;
|
||||
+ TraceMessageFilterSet pending_capture_monitoring_filters_;
|
||||
// Pending acks for GetTraceBufferPercentFull.
|
||||
int pending_trace_buffer_percent_full_ack_count_;
|
||||
+ TraceMessageFilterSet pending_trace_buffer_percent_full_filters_;
|
||||
float maximum_trace_buffer_percent_full_;
|
||||
|
||||
bool is_recording_;
|
|
@ -1,12 +1,12 @@
|
|||
Index: underlay_opengl_hosting_window.h
|
||||
===================================================================
|
||||
--- underlay_opengl_hosting_window.h (revision 214871)
|
||||
--- underlay_opengl_hosting_window.h (revision 248478)
|
||||
+++ underlay_opengl_hosting_window.h (working copy)
|
||||
@@ -12,7 +12,7 @@
|
||||
// Common base class for windows that host a OpenGL surface that renders under
|
||||
// the window. Contains methods relating to hole punching so that the OpenGL
|
||||
// surface is visible through the window.
|
||||
-UI_EXPORT
|
||||
-UI_BASE_EXPORT
|
||||
+__attribute__((visibility("default")))
|
||||
@interface UnderlayOpenGLHostingWindow : NSWindow
|
||||
@end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Index: desktop_aura/desktop_root_window_host_win.cc
|
||||
===================================================================
|
||||
--- desktop_aura/desktop_root_window_host_win.cc (revision 242756)
|
||||
--- desktop_aura/desktop_root_window_host_win.cc (revision 248478)
|
||||
+++ desktop_aura/desktop_root_window_host_win.cc (working copy)
|
||||
@@ -131,7 +131,9 @@
|
||||
@@ -132,7 +132,9 @@
|
||||
native_widget_delegate_);
|
||||
|
||||
HWND parent_hwnd = NULL;
|
||||
|
@ -13,9 +13,9 @@ Index: desktop_aura/desktop_root_window_host_win.cc
|
|||
parent_hwnd =
|
||||
params.parent->GetDispatcher()->host()->GetAcceleratedWidget();
|
||||
}
|
||||
@@ -752,7 +754,7 @@
|
||||
@@ -771,7 +773,7 @@
|
||||
|
||||
void DesktopRootWindowHostWin::HandleCreate() {
|
||||
void DesktopWindowTreeHostWin::HandleCreate() {
|
||||
// TODO(beng): moar
|
||||
- NOTIMPLEMENTED();
|
||||
+ // NOTIMPLEMENTED();
|
||||
|
@ -24,7 +24,7 @@ Index: desktop_aura/desktop_root_window_host_win.cc
|
|||
|
||||
Index: desktop_aura/desktop_screen_win.cc
|
||||
===================================================================
|
||||
--- desktop_aura/desktop_screen_win.cc (revision 242756)
|
||||
--- desktop_aura/desktop_screen_win.cc (revision 248478)
|
||||
+++ desktop_aura/desktop_screen_win.cc (working copy)
|
||||
@@ -54,6 +54,8 @@
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ Index: desktop_aura/desktop_screen_win.cc
|
|||
}
|
||||
Index: widget.h
|
||||
===================================================================
|
||||
--- widget.h (revision 242756)
|
||||
--- widget.h (revision 248478)
|
||||
+++ widget.h (working copy)
|
||||
@@ -197,6 +197,7 @@
|
||||
// Should the widget be double buffered? Default is false.
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
Index: browser/browser_plugin/browser_plugin_guest.cc
|
||||
===================================================================
|
||||
--- browser/browser_plugin/browser_plugin_guest.cc (revision 248478)
|
||||
+++ browser/browser_plugin/browser_plugin_guest.cc (working copy)
|
||||
@@ -785,7 +785,8 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
-bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) {
|
||||
+bool BrowserPluginGuest::HandleContextMenu(RenderFrameHost* render_frame_host,
|
||||
+ const ContextMenuParams& params) {
|
||||
// TODO(fsamuel): We show the regular page context menu handler for now until
|
||||
// we implement the Apps Context Menu API for Browser Plugin (see
|
||||
// http://crbug.com/140315).
|
||||
Index: browser/browser_plugin/browser_plugin_guest.h
|
||||
===================================================================
|
||||
--- browser/browser_plugin/browser_plugin_guest.h (revision 248478)
|
||||
+++ browser/browser_plugin/browser_plugin_guest.h (working copy)
|
||||
@@ -200,7 +200,8 @@
|
||||
double progress) OVERRIDE;
|
||||
virtual void CloseContents(WebContents* source) OVERRIDE;
|
||||
virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
|
||||
- virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE;
|
||||
+ virtual bool HandleContextMenu(RenderFrameHost* render_frame_host,
|
||||
+ const ContextMenuParams& params) OVERRIDE;
|
||||
virtual void HandleKeyboardEvent(
|
||||
WebContents* source,
|
||||
const NativeWebKeyboardEvent& event) OVERRIDE;
|
||||
Index: browser/web_contents/web_contents_impl.cc
|
||||
===================================================================
|
||||
--- browser/web_contents/web_contents_impl.cc (revision 248478)
|
||||
+++ browser/web_contents/web_contents_impl.cc (working copy)
|
||||
@@ -2687,7 +2687,7 @@
|
||||
void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host,
|
||||
const ContextMenuParams& params) {
|
||||
// Allow WebContentsDelegates to handle the context menu operation first.
|
||||
- if (delegate_ && delegate_->HandleContextMenu(params))
|
||||
+ if (delegate_ && delegate_->HandleContextMenu(render_frame_host, params))
|
||||
return;
|
||||
|
||||
render_view_host_delegate_view_->ShowContextMenu(render_frame_host, params);
|
||||
Index: browser/web_contents/web_contents_view_mac.mm
|
||||
===================================================================
|
||||
--- browser/web_contents/web_contents_view_mac.mm (revision 248478)
|
||||
+++ browser/web_contents/web_contents_view_mac.mm (working copy)
|
||||
@@ -233,12 +233,6 @@
|
||||
void WebContentsViewMac::ShowContextMenu(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const ContextMenuParams& params) {
|
||||
- // Allow delegates to handle the context menu operation first.
|
||||
- if (web_contents_->GetDelegate() &&
|
||||
- web_contents_->GetDelegate()->HandleContextMenu(params)) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
if (delegate())
|
||||
delegate()->ShowContextMenu(render_frame_host, params);
|
||||
else
|
||||
Index: public/browser/web_contents_delegate.cc
|
||||
===================================================================
|
||||
--- public/browser/web_contents_delegate.cc (revision 248478)
|
||||
+++ public/browser/web_contents_delegate.cc (working copy)
|
||||
@@ -76,6 +76,7 @@
|
||||
}
|
||||
|
||||
bool WebContentsDelegate::HandleContextMenu(
|
||||
+ RenderFrameHost* render_frame_host,
|
||||
const content::ContextMenuParams& params) {
|
||||
return false;
|
||||
}
|
||||
Index: public/browser/web_contents_delegate.h
|
||||
===================================================================
|
||||
--- public/browser/web_contents_delegate.h (revision 248478)
|
||||
+++ public/browser/web_contents_delegate.h (working copy)
|
||||
@@ -35,6 +35,7 @@
|
||||
class DownloadItem;
|
||||
class JavaScriptDialogManager;
|
||||
class PageState;
|
||||
+class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
class SessionStorageNamespace;
|
||||
class WebContents;
|
||||
@@ -228,7 +229,8 @@
|
||||
virtual int GetExtraRenderViewHeight() const;
|
||||
|
||||
// Returns true if the context menu operation was handled by the delegate.
|
||||
- virtual bool HandleContextMenu(const content::ContextMenuParams& params);
|
||||
+ virtual bool HandleContextMenu(RenderFrameHost* render_frame_host,
|
||||
+ const content::ContextMenuParams& params);
|
||||
|
||||
// Opens source view for given WebContents that is navigated to the given
|
||||
// page url.
|
|
@ -1,8 +1,8 @@
|
|||
Index: WebNode.cpp
|
||||
===================================================================
|
||||
--- WebNode.cpp (revision 160715)
|
||||
--- WebNode.cpp (revision 166298)
|
||||
+++ WebNode.cpp (working copy)
|
||||
@@ -169,7 +169,7 @@
|
||||
@@ -171,7 +171,7 @@
|
||||
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
|
||||
{
|
||||
// Please do not add more eventTypes to this list without an API review.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Index: public/web/WebView.h
|
||||
===================================================================
|
||||
--- public/web/WebView.h (revision 164381)
|
||||
--- public/web/WebView.h (revision 166298)
|
||||
+++ public/web/WebView.h (working copy)
|
||||
@@ -417,6 +417,7 @@
|
||||
|
||||
|
@ -12,9 +12,9 @@ Index: public/web/WebView.h
|
|||
virtual void hidePopups() = 0;
|
||||
Index: Source/web/ChromeClientImpl.cpp
|
||||
===================================================================
|
||||
--- Source/web/ChromeClientImpl.cpp (revision 164381)
|
||||
--- Source/web/ChromeClientImpl.cpp (revision 166298)
|
||||
+++ Source/web/ChromeClientImpl.cpp (working copy)
|
||||
@@ -851,7 +851,7 @@
|
||||
@@ -828,7 +828,7 @@
|
||||
|
||||
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
|
||||
{
|
||||
|
@ -25,9 +25,9 @@ Index: Source/web/ChromeClientImpl.cpp
|
|||
return adoptRef(new PopupMenuChromium(frame, client));
|
||||
Index: Source/web/WebViewImpl.cpp
|
||||
===================================================================
|
||||
--- Source/web/WebViewImpl.cpp (revision 164381)
|
||||
--- Source/web/WebViewImpl.cpp (revision 166298)
|
||||
+++ Source/web/WebViewImpl.cpp (working copy)
|
||||
@@ -348,6 +348,7 @@
|
||||
@@ -340,6 +340,7 @@
|
||||
, m_fakePageScaleAnimationPageScaleFactor(0)
|
||||
, m_fakePageScaleAnimationUseAnchor(false)
|
||||
, m_contextMenuAllowed(false)
|
||||
|
@ -35,7 +35,7 @@ Index: Source/web/WebViewImpl.cpp
|
|||
, m_doingDragAndDrop(false)
|
||||
, m_ignoreInputEvents(false)
|
||||
, m_compositorDeviceScaleFactorOverride(0)
|
||||
@@ -3552,9 +3553,14 @@
|
||||
@@ -3517,9 +3518,14 @@
|
||||
updateLayerTreeViewport();
|
||||
}
|
||||
|
||||
|
@ -53,9 +53,9 @@ Index: Source/web/WebViewImpl.cpp
|
|||
void WebViewImpl::startDragging(Frame* frame,
|
||||
Index: Source/web/WebViewImpl.h
|
||||
===================================================================
|
||||
--- Source/web/WebViewImpl.h (revision 164381)
|
||||
--- Source/web/WebViewImpl.h (revision 166298)
|
||||
+++ Source/web/WebViewImpl.h (working copy)
|
||||
@@ -398,7 +398,8 @@
|
||||
@@ -397,7 +397,8 @@
|
||||
|
||||
// Returns true if popup menus should be rendered by the browser, false if
|
||||
// they should be rendered by WebKit (which is the default).
|
||||
|
@ -65,7 +65,7 @@ Index: Source/web/WebViewImpl.h
|
|||
|
||||
bool contextMenuAllowed() const
|
||||
{
|
||||
@@ -680,6 +681,8 @@
|
||||
@@ -683,6 +684,8 @@
|
||||
|
||||
bool m_contextMenuAllowed;
|
||||
|
||||
|
|
|
@ -62,6 +62,9 @@ void AppGetSettings(CefSettings& settings) {
|
|||
|
||||
CefString(&settings.cache_path) =
|
||||
g_command_line->GetSwitchValue(cefclient::kCachePath);
|
||||
|
||||
if (g_command_line->HasSwitch(cefclient::kOffScreenRenderingEnabled))
|
||||
settings.windowless_rendering_enabled = true;
|
||||
}
|
||||
|
||||
bool AppIsOffScreenRenderingEnabled() {
|
||||
|
|
|
@ -360,8 +360,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
CefRefPtr<OSRWindow> osr_window =
|
||||
OSRWindow::Create(&g_main_browser_provider, transparent, vbox);
|
||||
window_info.SetAsOffScreen(osr_window->GetWindowHandle());
|
||||
window_info.SetTransparentPainting(transparent);
|
||||
window_info.SetAsWindowless(osr_window->GetWindowHandle(), transparent);
|
||||
g_handler->SetOSRHandler(osr_window.get());
|
||||
} else {
|
||||
window_info.SetAsChild(vbox);
|
||||
|
|
|
@ -355,8 +355,7 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) {
|
|||
CefRefPtr<OSRWindow> osr_window =
|
||||
OSRWindow::Create(&g_main_browser_provider, transparent, contentView,
|
||||
CefRect(0, 0, kWindowWidth, kWindowHeight));
|
||||
window_info.SetAsOffScreen(osr_window->GetWindowHandle());
|
||||
window_info.SetTransparentPainting(transparent);
|
||||
window_info.SetAsWindowless(osr_window->GetWindowHandle(), transparent);
|
||||
g_handler->SetOSRHandler(osr_window->GetRenderHandler().get());
|
||||
} else {
|
||||
// Initialize window info to the defaults for a child window.
|
||||
|
|
|
@ -394,8 +394,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|||
CefRefPtr<OSRWindow> osr_window =
|
||||
OSRWindow::Create(&g_main_browser_provider, transparent);
|
||||
osr_window->CreateWidget(hWnd, rect, hInst, szOSRWindowClass);
|
||||
info.SetAsOffScreen(osr_window->hwnd());
|
||||
info.SetTransparentPainting(transparent ? TRUE : FALSE);
|
||||
info.SetAsWindowless(osr_window->hwnd(), transparent);
|
||||
g_handler->SetOSRHandler(osr_window.get());
|
||||
} else {
|
||||
// Initialize window info to the defaults for a child window.
|
||||
|
|
|
@ -644,7 +644,7 @@ void ClientHandler::CloseDevTools(CefRefPtr<CefBrowser> browser) {
|
|||
|
||||
void ClientHandler::BeginTracing() {
|
||||
if (CefCurrentlyOn(TID_UI)) {
|
||||
CefBeginTracing(CefString());
|
||||
CefBeginTracing(CefString(), NULL);
|
||||
} else {
|
||||
CefPostTask(TID_UI,
|
||||
NewCefRunnableMethod(this, &ClientHandler::BeginTracing));
|
||||
|
@ -678,10 +678,10 @@ void ClientHandler::EndTracing() {
|
|||
const std::vector<CefString>& file_paths) OVERRIDE {
|
||||
if (!file_paths.empty()) {
|
||||
// File selected. Results in a call to OnEndTracingComplete.
|
||||
CefEndTracingAsync(file_paths.front(), this);
|
||||
CefEndTracing(file_paths.front(), this);
|
||||
} else {
|
||||
// No file selected. Discard the trace data.
|
||||
CefEndTracingAsync(CefString(), NULL);
|
||||
CefEndTracing(CefString(), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -574,9 +574,9 @@ TEST(CookieTest, ChangeDirectoryCreated) {
|
|||
|
||||
namespace {
|
||||
|
||||
class TestCompletionHandler : public CefCompletionHandler {
|
||||
class TestCompletionCallback : public CefCompletionCallback {
|
||||
public:
|
||||
explicit TestCompletionHandler(base::WaitableEvent* event)
|
||||
explicit TestCompletionCallback(base::WaitableEvent* event)
|
||||
: event_(event) {}
|
||||
|
||||
virtual void OnComplete() OVERRIDE {
|
||||
|
@ -586,7 +586,7 @@ class TestCompletionHandler : public CefCompletionHandler {
|
|||
private:
|
||||
base::WaitableEvent* event_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(TestCompletionHandler);
|
||||
IMPLEMENT_REFCOUNTING(TestCompletionCallback);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@ -610,7 +610,7 @@ TEST(CookieTest, SessionCookieNoPersist) {
|
|||
GetCookie(manager, cookie, true, event, false);
|
||||
|
||||
// Flush the cookie store to disk.
|
||||
manager->FlushStore(new TestCompletionHandler(&event));
|
||||
manager->FlushStore(new TestCompletionCallback(&event));
|
||||
event.Wait();
|
||||
|
||||
// Create a new manager to read the same cookie store.
|
||||
|
@ -640,7 +640,7 @@ TEST(CookieTest, SessionCookieWillPersist) {
|
|||
GetCookie(manager, cookie, true, event, false);
|
||||
|
||||
// Flush the cookie store to disk.
|
||||
manager->FlushStore(new TestCompletionHandler(&event));
|
||||
manager->FlushStore(new TestCompletionCallback(&event));
|
||||
event.Wait();
|
||||
|
||||
// Create a new manager to read the same cookie store.
|
||||
|
|
|
@ -826,22 +826,23 @@ class OSRTestHandler : public RoutingTestHandler,
|
|||
void CreateOSRBrowser(const CefString& url) {
|
||||
CefWindowInfo windowInfo;
|
||||
CefBrowserSettings settings;
|
||||
|
||||
const bool transparent = (test_type_ == OSR_TEST_TRANSPARENCY);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
windowInfo.SetAsOffScreen(GetDesktopWindow());
|
||||
windowInfo.SetAsWindowless(GetDesktopWindow(), transparent);
|
||||
#elif defined(OS_MACOSX)
|
||||
// An actual vies is needed only for the ContextMenu test. The menu runner
|
||||
// checks if the view is not nil before showing the context menu.
|
||||
if (test_type_ == OSR_TEST_CONTEXT_MENU)
|
||||
windowInfo.SetAsOffScreen(osr_unittests::GetFakeView());
|
||||
windowInfo.SetAsWindowless(osr_unittests::GetFakeView(), transparent);
|
||||
else
|
||||
windowInfo.SetAsOffScreen(NULL);
|
||||
windowInfo.SetAsWindowless(NULL, transparent);
|
||||
#elif defined(OS_LINUX)
|
||||
windowInfo.SetAsOffScreen(NULL);
|
||||
windowInfo.SetAsWindowless(NULL, transparent);
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
if (test_type_ == OSR_TEST_TRANSPARENCY)
|
||||
windowInfo.SetTransparentPainting(TRUE);
|
||||
CefBrowserHost::CreateBrowser(windowInfo, this, url, settings, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -245,6 +245,7 @@ bool TestFailed();
|
|||
|
||||
#define EXPECT_UI_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_UI));
|
||||
#define EXPECT_IO_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_IO));
|
||||
#define EXPECT_FILE_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_FILE));
|
||||
#define EXPECT_RENDERER_THREAD() EXPECT_TRUE(CefCurrentlyOn(TID_RENDERER));
|
||||
|
||||
#endif // CEF_TESTS_UNITTESTS_TEST_HANDLER_H_
|
||||
|
|
|
@ -61,6 +61,9 @@ void CefTestSuite::GetSettings(CefSettings& settings) {
|
|||
|
||||
// Necessary for V8Test.OnUncaughtException tests.
|
||||
settings.uncaught_exception_stack_size = 10;
|
||||
|
||||
// Necessary for the OSRTest tests.
|
||||
settings.windowless_rendering_enabled = true;
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -65,7 +65,8 @@ enum TracingTestType {
|
|||
|
||||
const char kTraceTestCategory[] = "test_category";
|
||||
|
||||
class TracingTestHandler : public CefEndTracingCallback {
|
||||
class TracingTestHandler : public CefEndTracingCallback,
|
||||
public CefCompletionCallback {
|
||||
public:
|
||||
TracingTestHandler(TracingTestType type, const char* trace_type)
|
||||
: completion_event_(true, false),
|
||||
|
@ -74,7 +75,7 @@ class TracingTestHandler : public CefEndTracingCallback {
|
|||
}
|
||||
|
||||
void ReadTracingFile(const base::FilePath& file_path) {
|
||||
EXPECT_TRUE(CefCurrentlyOn(TID_FILE));
|
||||
EXPECT_FILE_THREAD();
|
||||
|
||||
base::ReadFileToString(file_path, &trace_data_);
|
||||
base::DeleteFile(file_path, false);
|
||||
|
@ -84,7 +85,7 @@ class TracingTestHandler : public CefEndTracingCallback {
|
|||
|
||||
// CefEndTracingCallback method:
|
||||
virtual void OnEndTracingComplete(const CefString& tracing_file) OVERRIDE {
|
||||
EXPECT_TRUE(CefCurrentlyOn(TID_UI));
|
||||
EXPECT_UI_THREAD();
|
||||
|
||||
base::FilePath file_path(tracing_file);
|
||||
CefPostTask(TID_FILE,
|
||||
|
@ -93,9 +94,14 @@ class TracingTestHandler : public CefEndTracingCallback {
|
|||
}
|
||||
|
||||
void RunTracing() {
|
||||
EXPECT_TRUE(CefCurrentlyOn(TID_UI));
|
||||
EXPECT_UI_THREAD();
|
||||
|
||||
CefBeginTracing(kTraceTestCategory);
|
||||
// Results in a call to OnComplete.
|
||||
CefBeginTracing(kTraceTestCategory, this);
|
||||
}
|
||||
|
||||
virtual void OnComplete() OVERRIDE {
|
||||
EXPECT_UI_THREAD();
|
||||
|
||||
switch (type_) {
|
||||
case CEF_TRACE_EVENT0: {
|
||||
|
@ -313,7 +319,7 @@ class TracingTestHandler : public CefEndTracingCallback {
|
|||
}
|
||||
|
||||
// Results in a call to OnEndTracingComplete.
|
||||
CefEndTracingAsync(CefString(), this);
|
||||
CefEndTracing(CefString(), this);
|
||||
}
|
||||
|
||||
void ExecuteTest() {
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
..\..\third_party\python_26\python.exe check_style.py %*
|
||||
python.bat check_style.py %*
|
||||
|
|
|
@ -221,6 +221,7 @@
|
|||
'files': [
|
||||
'Resources/cef.pak',
|
||||
'Resources/devtools_resources.pak',
|
||||
'Resources/icudtl.dat',
|
||||
'Resources/locales/',
|
||||
'$(BUILDTYPE)/chrome-sandbox',
|
||||
'$(BUILDTYPE)/libcef.so',
|
||||
|
@ -433,6 +434,7 @@
|
|||
'files': [
|
||||
'Resources/cef.pak',
|
||||
'Resources/devtools_resources.pak',
|
||||
'Resources/icudtl.dat',
|
||||
'Resources/locales/',
|
||||
'$(BUILDTYPE)/chrome-sandbox',
|
||||
'$(BUILDTYPE)/libcef.so',
|
||||
|
|
|
@ -11,6 +11,9 @@ Required components:
|
|||
* CEF core library
|
||||
libcef.so
|
||||
|
||||
* Unicode support
|
||||
icudtl.dat
|
||||
|
||||
Optional components:
|
||||
|
||||
* Localized resources
|
||||
|
|
|
@ -19,6 +19,7 @@ cefclient.app/
|
|||
Resources/
|
||||
cef.pak, devtools_resources.pak <= non-localized resources and strings
|
||||
crash_inspector, crash_report_sender <= breakpad support
|
||||
icudtl.dat <= unicode support
|
||||
en.lproj/, ... <= locale-specific resources and strings
|
||||
Info.plist
|
||||
libplugin_carbon_interpose.dylib <= plugin support library
|
||||
|
@ -68,6 +69,9 @@ Required components:
|
|||
* CEF framework library
|
||||
Chromium Embedded Framework.framework/Chromium Embedded Framework
|
||||
|
||||
* Unicode support
|
||||
Chromium Embedded Framework.framework/Resources/icudtl.dat
|
||||
|
||||
* Plugin support library
|
||||
libplugin_carbon_interpose.dylib
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ Required components:
|
|||
libcef.dll
|
||||
|
||||
* Unicode support
|
||||
icudt.dll
|
||||
icudtl.dat
|
||||
|
||||
Optional components:
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
..\..\third_party\python_26\python.exe make_distrib.py --output-dir ..\binary_distrib\ %*
|
||||
python.bat make_distrib.py --output-dir ..\binary_distrib\ %*
|
||||
|
|
|
@ -490,6 +490,14 @@ if mode == 'standard':
|
|||
output_dir, options.quiet)
|
||||
|
||||
if platform == 'windows':
|
||||
binaries = [
|
||||
'd3dcompiler_46.dll',
|
||||
'ffmpegsumo.dll',
|
||||
'libcef.dll',
|
||||
'libEGL.dll',
|
||||
'libGLESv2.dll',
|
||||
]
|
||||
|
||||
if options.ninjabuild:
|
||||
out_dir = os.path.join(src_dir, 'out')
|
||||
libcef_dll_file = 'libcef.dll.lib'
|
||||
|
@ -525,7 +533,8 @@ if platform == 'windows':
|
|||
dst_dir = os.path.join(output_dir, 'Debug')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
copy_files(os.path.join(build_dir, '*.dll'), dst_dir, options.quiet)
|
||||
for binary in binaries:
|
||||
copy_file(os.path.join(build_dir, binary), os.path.join(dst_dir, binary), options.quiet)
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
options.quiet)
|
||||
combine_libs(build_dir, sandbox_libs, os.path.join(dst_dir, 'cef_sandbox.lib'));
|
||||
|
@ -545,7 +554,8 @@ if platform == 'windows':
|
|||
dst_dir = os.path.join(output_dir, 'Release')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
copy_files(os.path.join(script_dir, 'distrib/win/*.dll'), dst_dir, options.quiet)
|
||||
copy_files(os.path.join(build_dir, '*.dll'), dst_dir, options.quiet)
|
||||
for binary in binaries:
|
||||
copy_file(os.path.join(build_dir, binary), os.path.join(dst_dir, binary), options.quiet)
|
||||
|
||||
if mode != 'client':
|
||||
copy_file(os.path.join(build_dir, libcef_dll_file), os.path.join(dst_dir, 'libcef.lib'), \
|
||||
|
@ -572,6 +582,7 @@ if platform == 'windows':
|
|||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'icudtl.dat'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
if mode == 'standard':
|
||||
|
@ -735,6 +746,7 @@ elif platform == 'linux':
|
|||
make_dir(dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cef.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'devtools_resources.pak'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'icudtl.dat'), dst_dir, options.quiet)
|
||||
copy_dir(os.path.join(build_dir, 'locales'), os.path.join(dst_dir, 'locales'), options.quiet)
|
||||
|
||||
if mode == 'standard':
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
..\third_party\python_26\python.exe tools\make_version_header.py --header include\cef_version.h --cef_version VERSION --chrome_version ../chrome/VERSION --cpp_header_dir include
|
||||
python.bat tools\make_version_header.py --header include\cef_version.h --cef_version VERSION --chrome_version ../chrome/VERSION --cpp_header_dir include
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
..\third_party\python_26\python.exe tools\patcher.py --patch-config patch/patch.cfg
|
||||
python.bat tools\patcher.py --patch-config patch/patch.cfg
|
|
@ -1,3 +1,3 @@
|
|||
@echo off
|
||||
..\..\third_party\python_26\python.exe translator.py --cpp-header-dir ..\include --capi-header-dir ..\include\capi --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp --gypi-file ..\cef_paths.gypi
|
||||
call python.bat translator.py --cpp-header-dir ..\include --capi-header-dir ..\include\capi --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp --gypi-file ..\cef_paths.gypi
|
||||
pause
|
Loading…
Reference in New Issue