Update to Chromium revision ad468e8b (#292352).

- Building Chromium using SVN is no longer supported.
- Remove CefDOMEvent and CefDOMEventListener (issue #933).
- Remove CefRenderHandler::OnScrollOffsetChanged (http://crbug.com/404656).
- Remove UR_FLAG_REPORT_LOAD_TIMING (https://codereview.chromium.org/451623002/).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1816 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2014-09-04 17:53:40 +00:00
parent 3f3ffdedee
commit 0b78461f5b
117 changed files with 1698 additions and 2257 deletions

View File

@ -7,7 +7,5 @@
# https://code.google.com/p/chromiumembedded/wiki/BranchesAndBuilding
{
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '280796',
'chromium_checkout': 'e800fe7470fa87dc1ca5b148a7c2c41f603fdcbd',
'chromium_checkout': 'ad468e8b47617a4f9fb70fecfd9ea320e6f8c1cf',
}

60
cef.gyp
View File

@ -634,7 +634,7 @@
'type': 'none',
'dependencies': [
'<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
'<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
'cef_strings',
],
'actions': [
@ -717,11 +717,12 @@
'target_name': 'cef_pak',
'type': 'none',
'dependencies': [
'<(DEPTH)/components/components_strings.gyp:components_strings',
'<(DEPTH)/content/app/resources/content_resources.gyp:content_resources',
'<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
'<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
'<(DEPTH)/content/content_resources.gyp:content_resources',
'<(DEPTH)/net/net.gyp:net_resources',
'<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
'cef_locales',
'cef_resources',
],
@ -733,9 +734,9 @@
'action_name': 'repack_cef_pack',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
'<(grit_out_dir)/cef_resources.pak',
],
'pak_output': '<(PRODUCT_DIR)/cef.pak',
@ -746,8 +747,8 @@
'action_name': 'repack_cef_100_percent_pack',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
],
'pak_output': '<(PRODUCT_DIR)/cef_100_percent.pak',
},
@ -757,8 +758,8 @@
'action_name': 'repack_cef_200_percent_pack',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_200_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_200_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_200_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_200_percent.pak',
],
'pak_output': '<(PRODUCT_DIR)/cef_200_percent.pak',
},
@ -768,12 +769,11 @@
'action_name': 'make_pack_resources_header',
'variables': {
'header_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/grit/blink_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/content/grit/content_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/net/grit/net_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/ui_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/grit/ui_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/grit/devtools_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/grit/blink_resources.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/grit/webkit_resources.h',
'<(grit_out_dir)/grit/cef_resources.h',
],
},
@ -791,8 +791,9 @@
'action_name': 'make_pack_strings_header',
'variables': {
'header_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/grit/ui_strings.h',
'<(SHARED_INTERMEDIATE_DIR)/webkit/grit/webkit_strings.h',
'<(SHARED_INTERMEDIATE_DIR)/components/strings/grit/components_strings.h',
'<(SHARED_INTERMEDIATE_DIR)/content/app/strings/grit/content_strings.h',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings/grit/ui_strings.h',
'<(grit_out_dir)/grit/cef_strings.h',
],
},
@ -831,8 +832,8 @@
# CEF grit resource includes
'<(DEPTH)/cef/libcef/resources/grit_stub',
'<(grit_out_dir)',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings',
'<(SHARED_INTERMEDIATE_DIR)/webkit',
],
'dependencies': [
@ -840,9 +841,13 @@
'<(DEPTH)/base/base.gyp:base_prefs',
'<(DEPTH)/base/base.gyp:base_static',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/cc/blink/cc_blink.gyp:cc_blink',
'<(DEPTH)/cc/cc.gyp:cc',
'<(DEPTH)/components/components.gyp:breakpad_component',
'<(DEPTH)/components/components.gyp:crash_component',
'<(DEPTH)/components/components.gyp:navigation_interception',
'<(DEPTH)/components/components.gyp:pdf_browser',
'<(DEPTH)/components/components.gyp:pdf_common',
'<(DEPTH)/components/components.gyp:pdf_renderer',
'<(DEPTH)/content/content.gyp:content_app_both',
'<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/content/content.gyp:content_common',
@ -850,9 +855,8 @@
'<(DEPTH)/content/content.gyp:content_plugin',
'<(DEPTH)/content/content.gyp:content_ppapi_plugin',
'<(DEPTH)/content/content.gyp:content_renderer',
'<(DEPTH)/content/content.gyp:content_resources',
'<(DEPTH)/content/content.gyp:content_utility',
'<(DEPTH)/content/content.gyp:content_worker',
'<(DEPTH)/content/content_resources.gyp:content_resources',
'<(DEPTH)/gpu/gpu.gyp:gpu',
'<(DEPTH)/ipc/ipc.gyp:ipc',
'<(DEPTH)/media/media.gyp:media',
@ -868,8 +872,7 @@
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/base/ui_base.gyp:ui_base',
'<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
'<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser',
'<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common',
'<(DEPTH)/webkit/storage_browser.gyp:storage',
# Necessary to generate the grit include files.
'cef_pak',
],
@ -1039,14 +1042,14 @@
'libcef/common/values_impl.h',
'libcef/common/upload_data.cc',
'libcef/common/upload_data.h',
'libcef/common/upload_element.cc',
'libcef/common/upload_element.h',
'libcef/renderer/browser_impl.cc',
'libcef/renderer/browser_impl.h',
'libcef/renderer/content_renderer_client.cc',
'libcef/renderer/content_renderer_client.h',
'libcef/renderer/dom_document_impl.cc',
'libcef/renderer/dom_document_impl.h',
'libcef/renderer/dom_event_impl.cc',
'libcef/renderer/dom_event_impl.h',
'libcef/renderer/dom_node_impl.cc',
'libcef/renderer/dom_node_impl.h',
'libcef/renderer/frame_impl.cc',
@ -1099,15 +1102,15 @@
'<(DEPTH)/chrome/browser/printing/print_job_manager.h',
'<(DEPTH)/chrome/browser/printing/print_job_worker.cc',
'<(DEPTH)/chrome/browser/printing/print_job_worker.h',
'<(DEPTH)/chrome/browser/printing/print_job_worker_owner.h',
'<(DEPTH)/chrome/browser/printing/print_job_worker_owner.cc',
'<(DEPTH)/chrome/browser/printing/print_job_worker_owner.h',
'<(DEPTH)/chrome/browser/printing/printer_query.cc',
'<(DEPTH)/chrome/browser/printing/printer_query.h',
'<(DEPTH)/chrome/browser/printing/printing_ui_web_contents_observer.cc',
'<(DEPTH)/chrome/browser/printing/printing_ui_web_contents_observer.h',
'<(DEPTH)/chrome/common/prerender_messages.h',
'<(DEPTH)/chrome/common/print_messages.cc',
'<(DEPTH)/chrome/common/print_messages.h',
'<(DEPTH)/chrome/renderer/pepper/chrome_pdf_print_client.cc',
'<(DEPTH)/chrome/renderer/pepper/chrome_pdf_print_client.h',
'<(DEPTH)/chrome/renderer/prerender/prerender_helper.cc',
'<(DEPTH)/chrome/renderer/prerender/prerender_helper.h',
'<(DEPTH)/chrome/renderer/printing/print_web_view_helper.cc',
@ -1116,9 +1119,6 @@
# determine the current locale.
'<(DEPTH)/chrome/browser/browser_process.cc',
'<(DEPTH)/chrome/browser/browser_process.h',
# Include sources for pepper PDF plugin support.
'<(DEPTH)/chrome/renderer/pepper/ppb_pdf_impl.cc',
'<(DEPTH)/chrome/renderer/pepper/ppb_pdf_impl.h',
],
'conditions': [
['OS=="win"', {
@ -1584,8 +1584,8 @@
'<@(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/blink_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_unscaled_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',
'libcef_dll/libcef_dll.rc',
],
'link_settings': {

View File

@ -154,10 +154,6 @@
'libcef_dll/ctocpp/cookie_visitor_ctocpp.h',
'libcef_dll/cpptoc/domdocument_cpptoc.cc',
'libcef_dll/cpptoc/domdocument_cpptoc.h',
'libcef_dll/cpptoc/domevent_cpptoc.cc',
'libcef_dll/cpptoc/domevent_cpptoc.h',
'libcef_dll/ctocpp/domevent_listener_ctocpp.cc',
'libcef_dll/ctocpp/domevent_listener_ctocpp.h',
'libcef_dll/cpptoc/domnode_cpptoc.cc',
'libcef_dll/cpptoc/domnode_cpptoc.h',
'libcef_dll/ctocpp/domvisitor_ctocpp.cc',
@ -324,10 +320,6 @@
'libcef_dll/cpptoc/cookie_visitor_cpptoc.h',
'libcef_dll/ctocpp/domdocument_ctocpp.cc',
'libcef_dll/ctocpp/domdocument_ctocpp.h',
'libcef_dll/ctocpp/domevent_ctocpp.cc',
'libcef_dll/ctocpp/domevent_ctocpp.h',
'libcef_dll/cpptoc/domevent_listener_cpptoc.cc',
'libcef_dll/cpptoc/domevent_listener_cpptoc.h',
'libcef_dll/ctocpp/domnode_ctocpp.cc',
'libcef_dll/ctocpp/domnode_ctocpp.h',
'libcef_dll/cpptoc/domvisitor_cpptoc.cc',

View File

@ -136,7 +136,6 @@
'cefclient_bundle_resources_common': [
'tests/cefclient/res/binding.html',
'tests/cefclient/res/dialogs.html',
'tests/cefclient/res/domaccess.html',
'tests/cefclient/res/localstorage.html',
'tests/cefclient/res/logo.png',
'tests/cefclient/res/osr_test.html',
@ -165,8 +164,6 @@
'tests/cefclient/client_switches.h',
'tests/cefclient/dialog_test.cpp',
'tests/cefclient/dialog_test.h',
'tests/cefclient/dom_test.cpp',
'tests/cefclient/dom_test.h',
'tests/cefclient/dragdrop_events.h',
'tests/cefclient/osrenderer.h',
'tests/cefclient/osrenderer.cpp',
@ -222,8 +219,6 @@
'tests/cefclient/client_switches.h',
'tests/cefclient/dialog_test.cpp',
'tests/cefclient/dialog_test.h',
'tests/cefclient/dom_test.cpp',
'tests/cefclient/dom_test.h',
'tests/cefclient/performance_test.cpp',
'tests/cefclient/performance_test.h',
'tests/cefclient/performance_test_setup.h',

View File

@ -45,7 +45,6 @@ extern "C" {
#endif
struct _cef_domdocument_t;
struct _cef_domevent_listener_t;
struct _cef_domnode_t;
///
@ -297,20 +296,6 @@ typedef struct _cef_domnode_t {
struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)(
struct _cef_domnode_t* self);
///
// Add an event listener to this node for the specified event type. If
// |useCapture| is true (1) then this listener will be considered a capturing
// listener. Capturing listeners will recieve all events of the specified type
// before the events are dispatched to any other event targets beneath the
// current node in the tree. Events which are bubbling upwards through the
// tree will not trigger a capturing listener. Separate calls to this function
// can be used to register the same listener with and without capture. See
// WebCore/dom/EventNames.h for the list of supported event types.
///
void (CEF_CALLBACK *add_event_listener)(struct _cef_domnode_t* self,
const cef_string_t* eventType, struct _cef_domevent_listener_t* listener,
int useCapture);
// The following functions are valid only for element nodes.
@ -361,85 +346,6 @@ typedef struct _cef_domnode_t {
} cef_domnode_t;
///
// Structure used to represent a DOM event. The functions of this structure
// should only be called on the render process main thread.
///
typedef struct _cef_domevent_t {
///
// Base structure.
///
cef_base_t base;
///
// Returns the event type.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t (CEF_CALLBACK *get_type)(struct _cef_domevent_t* self);
///
// Returns the event category.
///
cef_dom_event_category_t (CEF_CALLBACK *get_category)(
struct _cef_domevent_t* self);
///
// Returns the event processing phase.
///
cef_dom_event_phase_t (CEF_CALLBACK *get_phase)(struct _cef_domevent_t* self);
///
// Returns true (1) if the event can bubble up the tree.
///
int (CEF_CALLBACK *can_bubble)(struct _cef_domevent_t* self);
///
// Returns true (1) if the event can be canceled.
///
int (CEF_CALLBACK *can_cancel)(struct _cef_domevent_t* self);
///
// Returns the document associated with this event.
///
struct _cef_domdocument_t* (CEF_CALLBACK *get_document)(
struct _cef_domevent_t* self);
///
// Returns the target of the event.
///
struct _cef_domnode_t* (CEF_CALLBACK *get_target)(
struct _cef_domevent_t* self);
///
// Returns the current target of the event.
///
struct _cef_domnode_t* (CEF_CALLBACK *get_current_target)(
struct _cef_domevent_t* self);
} cef_domevent_t;
///
// Structure to implement for handling DOM events. The functions of this
// structure will be called on the render process main thread.
///
typedef struct _cef_domevent_listener_t {
///
// Base structure.
///
cef_base_t base;
///
// Called when an event is received. The event object passed to this function
// contains a snapshot of the DOM at the time this function is executed. DOM
// objects are only valid for the scope of this function. Do not keep
// references to or attempt to access any DOM objects outside the scope of
// this function.
///
void (CEF_CALLBACK *handle_event)(struct _cef_domevent_listener_t* self,
struct _cef_domevent_t* event);
} cef_domevent_listener_t;
#ifdef __cplusplus
}
#endif

View File

@ -147,12 +147,6 @@ typedef struct _cef_render_handler_t {
///
void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self,
struct _cef_browser_t* browser, cef_drag_operations_mask_t operation);
///
// Called when the scroll offset has changed.
///
void (CEF_CALLBACK *on_scroll_offset_changed)(
struct _cef_render_handler_t* self, struct _cef_browser_t* browser);
} cef_render_handler_t;

View File

@ -146,8 +146,8 @@ typedef struct _cef_request_t {
const cef_string_t* url);
///
// Get the resource type for this request. Accurate resource type information
// may only be available in the browser process.
// Get the resource type for this request. Only available in the browser
// process.
///
cef_resource_type_t (CEF_CALLBACK *get_resource_type)(
struct _cef_request_t* self);

View File

@ -42,7 +42,6 @@
#include <map>
class CefDOMDocument;
class CefDOMEventListener;
class CefDOMNode;
///
@ -291,22 +290,6 @@ class CefDOMNode : public virtual CefBase {
/*--cef()--*/
virtual CefRefPtr<CefDOMNode> GetLastChild() =0;
///
// Add an event listener to this node for the specified event type. If
// |useCapture| is true then this listener will be considered a capturing
// listener. Capturing listeners will recieve all events of the specified
// type before the events are dispatched to any other event targets beneath
// the current node in the tree. Events which are bubbling upwards through
// the tree will not trigger a capturing listener. Separate calls to this
// method can be used to register the same listener with and without capture.
// See WebCore/dom/EventNames.h for the list of supported event types.
///
/*--cef()--*/
virtual void AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener,
bool useCapture) =0;
// The following methods are valid only for element nodes.
///
@ -354,82 +337,4 @@ class CefDOMNode : public virtual CefBase {
virtual CefString GetElementInnerText() =0;
};
///
// Class used to represent a DOM event. The methods of this class should only
// be called on the render process main thread.
///
/*--cef(source=library)--*/
class CefDOMEvent : public virtual CefBase {
public:
typedef cef_dom_event_category_t Category;
typedef cef_dom_event_phase_t Phase;
///
// Returns the event type.
///
/*--cef()--*/
virtual CefString GetType() =0;
///
// Returns the event category.
///
/*--cef(default_retval=DOM_EVENT_CATEGORY_UNKNOWN)--*/
virtual Category GetCategory() =0;
///
// Returns the event processing phase.
///
/*--cef(default_retval=DOM_EVENT_PHASE_UNKNOWN)--*/
virtual Phase GetPhase() =0;
///
// Returns true if the event can bubble up the tree.
///
/*--cef()--*/
virtual bool CanBubble() =0;
///
// Returns true if the event can be canceled.
///
/*--cef()--*/
virtual bool CanCancel() =0;
///
// Returns the document associated with this event.
///
/*--cef()--*/
virtual CefRefPtr<CefDOMDocument> GetDocument() =0;
///
// Returns the target of the event.
///
/*--cef()--*/
virtual CefRefPtr<CefDOMNode> GetTarget() =0;
///
// Returns the current target of the event.
///
/*--cef()--*/
virtual CefRefPtr<CefDOMNode> GetCurrentTarget() =0;
};
///
// Interface to implement for handling DOM events. The methods of this class
// will be called on the render process main thread.
///
/*--cef(source=client)--*/
class CefDOMEventListener : public virtual CefBase {
public:
///
// Called when an event is received. The event object passed to this method
// contains a snapshot of the DOM at the time this method is executed. DOM
// objects are only valid for the scope of this method. Do not keep references
// to or attempt to access any DOM objects outside the scope of this method.
///
/*--cef()--*/
virtual void HandleEvent(CefRefPtr<CefDOMEvent> event) =0;
};
#endif // CEF_INCLUDE_CEF_DOM_H_

View File

@ -159,12 +159,6 @@ class CefRenderHandler : public virtual CefBase {
/*--cef()--*/
virtual void UpdateDragCursor(CefRefPtr<CefBrowser> browser,
DragOperation operation) {}
///
// Called when the scroll offset has changed.
///
/*--cef()--*/
virtual void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser) {}
};
#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_

View File

@ -155,8 +155,8 @@ class CefRequest : public virtual CefBase {
virtual void SetFirstPartyForCookies(const CefString& url) =0;
///
// Get the resource type for this request. Accurate resource type information
// may only be available in the browser process.
// Get the resource type for this request. Only available in the browser
// process.
///
/*--cef(default_retval=RT_SUB_RESOURCE)--*/
virtual ResourceType GetResourceType() =0;

View File

@ -1043,11 +1043,6 @@ typedef enum {
///
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3,
///
// If set load timing info will be collected for the request.
///
UR_FLAG_REPORT_LOAD_TIMING = 1 << 4,
///
// If set the headers sent and received for the request will be recorded.
///

View File

@ -123,7 +123,8 @@ content::BrowserPluginGuestManager* CefBrowserContextImpl::GetGuestManager() {
return NULL;
}
quota::SpecialStoragePolicy* CefBrowserContextImpl::GetSpecialStoragePolicy() {
storage::SpecialStoragePolicy*
CefBrowserContextImpl::GetSpecialStoragePolicy() {
return NULL;
}
@ -132,6 +133,11 @@ content::PushMessagingService*
return NULL;
}
content::SSLHostStateDelegate*
CefBrowserContextImpl::GetSSLHostStateDelegate() {
return NULL;
}
net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {

View File

@ -41,8 +41,9 @@ class CefBrowserContextImpl : public CefBrowserContext {
bool in_memory) OVERRIDE;
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE;
virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE;
// CefBrowserContext methods.
virtual net::URLRequestContextGetter* CreateRequestContext(

View File

@ -120,7 +120,7 @@ content::BrowserPluginGuestManager* CefBrowserContextProxy::GetGuestManager() {
return parent_->GetGuestManager();
}
quota::SpecialStoragePolicy*
storage::SpecialStoragePolicy*
CefBrowserContextProxy::GetSpecialStoragePolicy() {
return parent_->GetSpecialStoragePolicy();
}
@ -130,6 +130,11 @@ content::PushMessagingService*
return parent_->GetPushMessagingService();
}
content::SSLHostStateDelegate*
CefBrowserContextProxy::GetSSLHostStateDelegate() {
return parent_->GetSSLHostStateDelegate();
}
net::URLRequestContextGetter* CefBrowserContextProxy::CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) {

View File

@ -49,8 +49,9 @@ class CefBrowserContextProxy : public CefBrowserContext {
bool in_memory) OVERRIDE;
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE;
virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE;
// CefBrowserContext methods.
virtual net::URLRequestContextGetter* CreateRequestContext(

View File

@ -36,6 +36,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "components/pdf/common/pdf_messages.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/view_messages.h"
@ -57,7 +58,7 @@
#include "ui/shell_dialogs/selected_file_info.h"
#if defined(OS_LINUX) || defined(OS_ANDROID)
#include "ui/gfx/font_render_params_linux.h"
#include "ui/gfx/font_render_params.h"
#endif
#if defined(USE_AURA)
@ -428,57 +429,14 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::CreateInternal(
#if defined(OS_LINUX) || defined(OS_ANDROID)
content::RendererPreferences* prefs = web_contents->GetMutableRendererPrefs();
const gfx::FontRenderParams& params = gfx::GetDefaultWebKitFontRenderParams();
CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params,
(gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL)));
prefs->should_antialias_text = params.antialiasing;
prefs->use_subpixel_positioning = params.subpixel_positioning;
switch (params.hinting) {
case gfx::FontRenderParams::HINTING_NONE:
prefs->hinting = content::RENDERER_PREFERENCES_HINTING_NONE;
break;
case gfx::FontRenderParams::HINTING_SLIGHT:
prefs->hinting = content::RENDERER_PREFERENCES_HINTING_SLIGHT;
break;
case gfx::FontRenderParams::HINTING_MEDIUM:
prefs->hinting = content::RENDERER_PREFERENCES_HINTING_MEDIUM;
break;
case gfx::FontRenderParams::HINTING_FULL:
prefs->hinting = content::RENDERER_PREFERENCES_HINTING_FULL;
break;
default:
NOTREACHED() << "Unhandled hinting style " << params.hinting;
prefs->hinting = content::RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT;
break;
}
prefs->hinting = params.hinting;
prefs->use_autohinter = params.autohinter;
prefs->use_bitmaps = params.use_bitmaps;
switch (params.subpixel_rendering) {
case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE;
break;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB;
break;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR;
break;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB;
break;
case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR;
break;
default:
NOTREACHED() << "Unhandled subpixel rendering style "
<< params.subpixel_rendering;
prefs->subpixel_rendering =
content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT;
break;
}
prefs->subpixel_rendering = params.subpixel_rendering;
web_contents->GetRenderViewHost()->SyncRendererPrefs();
#endif // defined(OS_LINUX) || defined(OS_ANDROID)
@ -1552,8 +1510,8 @@ void CefBrowserHostImpl::LoadString(int64 frame_id, const std::string& string,
params.request_id = -1;
params.expect_response = false;
params.arguments.Append(base::Value::CreateStringValue(string));
params.arguments.Append(base::Value::CreateStringValue(url));
params.arguments.AppendString(string);
params.arguments.AppendString(url);
Send(new CefMsg_Request(routing_id(), params));
}
@ -1584,7 +1542,7 @@ void CefBrowserHostImpl::SendCommand(
params.expect_response = false;
}
params.arguments.Append(base::Value::CreateStringValue(command));
params.arguments.AppendString(command);
Send(new CefMsg_Request(routing_id(), params));
} else {
@ -1624,10 +1582,10 @@ void CefBrowserHostImpl::SendCode(
params.expect_response = false;
}
params.arguments.Append(base::Value::CreateBooleanValue(is_javascript));
params.arguments.Append(base::Value::CreateStringValue(code));
params.arguments.Append(base::Value::CreateStringValue(script_url));
params.arguments.Append(base::Value::CreateIntegerValue(script_start_line));
params.arguments.AppendBoolean(is_javascript);
params.arguments.AppendString(code);
params.arguments.AppendString(script_url);
params.arguments.AppendInteger(script_start_line);
Send(new CefMsg_Request(routing_id(), params));
} else {
@ -2359,9 +2317,9 @@ void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
void CefBrowserHostImpl::DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
bool is_main_frame,
const GURL& url,
content::PageTransition transition_type) {
const bool is_main_frame = !render_frame_host->GetParent();
CefRefPtr<CefFrame> frame = GetOrCreateFrame(
render_frame_host->GetRoutingID(),
CefFrameHostImpl::kUnspecifiedFrameId,
@ -2375,10 +2333,10 @@ void CefBrowserHostImpl::DidCommitProvisionalLoadForFrame(
void CefBrowserHostImpl::DidFailProvisionalLoad(
content::RenderFrameHost* render_frame_host,
bool is_main_frame,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
const bool is_main_frame = !render_frame_host->GetParent();
CefRefPtr<CefFrame> frame = GetOrCreateFrame(
render_frame_host->GetRoutingID(),
CefFrameHostImpl::kUnspecifiedFrameId,
@ -2394,14 +2352,16 @@ void CefBrowserHostImpl::DocumentAvailableInMainFrame() {
}
void CefBrowserHostImpl::DidFailLoad(
int64 frame_id,
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
bool is_main_frame,
int error_code,
const base::string16& error_description,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, base::string16(),
const base::string16& error_description) {
const bool is_main_frame = !render_frame_host->GetParent();
CefRefPtr<CefFrame> frame = GetOrCreateFrame(
render_frame_host->GetRoutingID(),
CefFrameHostImpl::kUnspecifiedFrameId,
is_main_frame,
base::string16(),
validated_url);
OnLoadError(frame, validated_url, error_code, error_description);
OnLoadEnd(frame, validated_url, error_code);
@ -2432,14 +2392,13 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(CefHostMsg_Request, OnRequest)
IPC_MESSAGE_HANDLER(CefHostMsg_Response, OnResponse)
IPC_MESSAGE_HANDLER(CefHostMsg_ResponseAck, OnResponseAck)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PDFHasUnsupportedFeature,
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFHasUnsupportedFeature,
OnPDFHasUnsupportedFeature)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PDFSaveURLAs, OnPDFSaveURLAs)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PDFUpdateContentRestrictions,
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFSaveURLAs, OnPDFSaveURLAs)
IPC_MESSAGE_HANDLER(PDFHostMsg_PDFUpdateContentRestrictions,
OnPDFUpdateContentRestrictions)
IPC_MESSAGE_HANDLER_DELAY_REPLY(
ChromeViewHostMsg_PDFModalPromptForPassword,
OnPDFModalPromptForPassword)
IPC_MESSAGE_HANDLER_DELAY_REPLY(PDFHostMsg_PDFModalPromptForPassword,
OnPDFModalPromptForPassword)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@ -2561,7 +2520,7 @@ void CefBrowserHostImpl::OnPDFModalPromptForPasswordClosed(
IPC::Message* reply_message,
bool success,
const base::string16& actual_value) {
ChromeViewHostMsg_PDFModalPromptForPassword::WriteReplyParams(
PDFHostMsg_PDFModalPromptForPassword::WriteReplyParams(
reply_message, base::UTF16ToUTF8(actual_value));
Send(reply_message);
}

View File

@ -409,22 +409,18 @@ class CefBrowserHostImpl : public CefBrowserHost,
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
bool is_main_frame,
const GURL& url,
content::PageTransition transition_type) OVERRIDE;
virtual void DidFailProvisionalLoad(
content::RenderFrameHost* render_frame_host,
bool is_main_frame,
const GURL& validated_url,
int error_code,
const base::string16& error_description) OVERRIDE;
virtual void DocumentAvailableInMainFrame() OVERRIDE;
virtual void DidFailLoad(int64 frame_id,
virtual void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
bool is_main_frame,
int error_code,
const base::string16& error_description,
content::RenderViewHost* render_view_host) OVERRIDE;
const base::string16& error_description) OVERRIDE;
virtual void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;

View File

@ -386,7 +386,7 @@ bool CefBrowserHostImpl::PlatformCreateWindow() {
// Make the content view for the window have a layer. This will make all
// sub-views have layers. This is necessary to ensure correct layer
// ordering of all child views and their layers.
[[[parentView window] contentView] cr_setWantsLayer:YES];
[[[parentView window] contentView] setWantsLayer:YES];
// Add a reference that will be released in the dealloc handler.
AddRef();

View File

@ -24,7 +24,6 @@
#include "net/base/net_module.h"
#include "net/proxy/proxy_resolver_v8.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
#if defined(USE_AURA)
#include "ui/aura/env.h"
@ -47,8 +46,7 @@
CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts(),
proxy_v8_isolate_(NULL) {
: BrowserMainParts() {
}
CefBrowserMainParts::~CefBrowserMainParts() {
@ -114,12 +112,6 @@ int CefBrowserMainParts::PreCreateThreads() {
pref_store_->SetInitializationCompleted();
pref_service_ = pref_store_->CreateService().Pass();
// Create a v8::Isolate for the current thread if it doesn't already exist.
if (!v8::Isolate::GetCurrent()) {
proxy_v8_isolate_ = v8::Isolate::New();
proxy_v8_isolate_->Enter();
}
// Initialize the V8 proxy integration.
net::ProxyResolverV8::EnsureIsolateCreated();
@ -175,11 +167,6 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
void CefBrowserMainParts::PostDestroyThreads() {
pref_proxy_config_tracker_.reset(NULL);
if (proxy_v8_isolate_) {
proxy_v8_isolate_->Exit();
proxy_v8_isolate_->Dispose();
}
#if defined(USE_AURA)
aura::Env::DeleteInstance();
delete views::ViewsDelegate::views_delegate;

View File

@ -27,10 +27,6 @@ namespace content {
struct MainFunctionParams;
}
namespace v8 {
class Isolate;
}
class CefBrowserContext;
class CefDevToolsDelegate;
@ -78,7 +74,6 @@ class CefBrowserMainParts : public content::BrowserMainParts {
scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_refptr<CefBrowserPrefStore> pref_store_;
scoped_ptr<PrefService> pref_service_;
v8::Isolate* proxy_v8_isolate_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
};

View File

@ -3,21 +3,8 @@
// found in the LICENSE file.
#include "libcef/browser/browser_main.h"
#include "libcef/browser/context.h"
#include "content/browser/renderer_host/compositing_iosurface_shader_programs_mac.h"
void CefBrowserMainParts::PlatformInitialize() {
const CefSettings& settings = CefContext::Get()->settings();
if (CefColorGetA(settings.background_color) > 0) {
const float r =
static_cast<float>(CefColorGetR(settings.background_color)) / 255.0f;
const float g =
static_cast<float>(CefColorGetG(settings.background_color)) / 255.0f;
const float b =
static_cast<float>(CefColorGetB(settings.background_color)) / 255.0f;
content::CompositingIOSurfaceShaderPrograms::SetBackgroundColor(r, g, b);
}
}
void CefBrowserMainParts::PlatformCleanup() {

View File

@ -6,15 +6,15 @@
#include <string>
#include "include/internal/cef_types_wrappers.h"
#include "libcef/common/cef_switches.h"
#include "base/command_line.h"
#include "include/internal/cef_types_wrappers.h"
#include "webkit/common/webpreferences.h"
#include "content/public/common/web_preferences.h"
// Set default preferences based on CEF command-line flags. Chromium command-
// line flags should not exist for these preferences.
void SetDefaults(WebPreferences& web) {
void SetDefaults(content::WebPreferences& web) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDefaultEncoding)) {
@ -55,31 +55,32 @@ void SetDefaults(WebPreferences& web) {
// Use the preferences from WebContentsImpl::GetWebkitPrefs and the
// WebPreferences constructor by default. Only override features that are
// explicitly enabled or disabled.
void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) {
void BrowserToWebSettings(const CefBrowserSettings& cef,
content::WebPreferences& web) {
SetDefaults(web);
if (cef.standard_font_family.length > 0) {
web.standard_font_family_map[webkit_glue::kCommonScript] =
web.standard_font_family_map[content::kCommonScript] =
CefString(&cef.standard_font_family);
}
if (cef.fixed_font_family.length > 0) {
web.fixed_font_family_map[webkit_glue::kCommonScript] =
web.fixed_font_family_map[content::kCommonScript] =
CefString(&cef.fixed_font_family);
}
if (cef.serif_font_family.length > 0) {
web.serif_font_family_map[webkit_glue::kCommonScript] =
web.serif_font_family_map[content::kCommonScript] =
CefString(&cef.serif_font_family);
}
if (cef.sans_serif_font_family.length > 0) {
web.sans_serif_font_family_map[webkit_glue::kCommonScript] =
web.sans_serif_font_family_map[content::kCommonScript] =
CefString(&cef.sans_serif_font_family);
}
if (cef.cursive_font_family.length > 0) {
web.cursive_font_family_map[webkit_glue::kCommonScript] =
web.cursive_font_family_map[content::kCommonScript] =
CefString(&cef.cursive_font_family);
}
if (cef.fantasy_font_family.length > 0) {
web.fantasy_font_family_map[webkit_glue::kCommonScript] =
web.fantasy_font_family_map[content::kCommonScript] =
CefString(&cef.fantasy_font_family);
}

View File

@ -8,8 +8,11 @@
#include "include/internal/cef_types_wrappers.h"
namespace content {
struct WebPreferences;
}
void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web);
void BrowserToWebSettings(const CefBrowserSettings& cef,
content::WebPreferences& web);
#endif // CEF_LIBCEF_BROWSER_BROWSER_SETTINGS_H_

View File

@ -162,7 +162,7 @@ class CefBrowserURLRequest::Context
return false;
std::string method = request_->GetMethod();
StringToLowerASCII(&method);
base::StringToLowerASCII(&method);
net::URLFetcher::RequestType request_type = net::URLFetcher::GET;
if (LowerCaseEqualsASCII(method, "get")) {
} else if (LowerCaseEqualsASCII(method, "post")) {
@ -277,9 +277,6 @@ class CefBrowserURLRequest::Context
upload_data_size_ = upload_data_size;
}
if (cef_flags & UR_FLAG_REPORT_LOAD_TIMING)
load_flags |= net::LOAD_ENABLE_LOAD_TIMING;
if (cef_flags & UR_FLAG_REPORT_RAW_HEADERS)
load_flags |= net::LOAD_REPORT_RAW_HEADERS;

View File

@ -30,7 +30,7 @@ MetricsServicesManager* ChromeBrowserProcessStub::GetMetricsServicesManager() {
return NULL;
}
MetricsService* ChromeBrowserProcessStub::metrics_service() {
metrics::MetricsService* ChromeBrowserProcessStub::metrics_service() {
NOTIMPLEMENTED();
return NULL;
}

View File

@ -32,7 +32,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
virtual void ResourceDispatcherHostCreated() OVERRIDE;
virtual void EndSession() OVERRIDE;
virtual MetricsServicesManager* GetMetricsServicesManager() OVERRIDE;
virtual MetricsService* metrics_service() OVERRIDE;
virtual metrics::MetricsService* metrics_service() OVERRIDE;
virtual rappor::RapporService* rappor_service() OVERRIDE;
virtual IOThread* io_thread() OVERRIDE;
virtual WatchDogThread* watchdog_thread() OVERRIDE;

View File

@ -41,15 +41,15 @@
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/storage_quota_params.h"
#include "content/public/common/web_preferences.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/ui_base_switches.h"
#include "url/gurl.h"
#include "webkit/common/webpreferences.h"
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include "base/debug/leak_annotations.h"
#include "components/breakpad/app/breakpad_linux.h"
#include "components/breakpad/browser/crash_handler_host_linux.h"
#include "components/crash/app/breakpad_linux.h"
#include "components/crash/browser/crash_handler_host_linux.h"
#include "content/public/common/content_descriptors.h"
#endif
@ -236,7 +236,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
const content::StorageQuotaParams& params,
int render_process_id,
const PermissionCallback& callback) OVERRIDE {
if (params.storage_type != quota::kStorageTypePersistent) {
if (params.storage_type != storage::kStorageTypePersistent) {
// To match Chrome behavior we only support requesting quota with this
// interface for Persistent storage type.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
@ -606,7 +606,7 @@ content::BrowserMainParts* CefContentBrowserClient::CreateBrowserMainParts(
void CefContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
host->GetChannel()->AddFilter(new CefBrowserMessageFilter(host));
host->AddFilter(new PrintingMessageFilter(host->GetID()));
host->AddFilter(new printing::PrintingMessageFilter(host->GetID()));
AddBrowserContextReference(
static_cast<CefBrowserContext*>(host->GetBrowserContext()));
@ -643,7 +643,7 @@ bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid())
return false;
const std::string& scheme = url.scheme();
DCHECK_EQ(scheme, StringToLowerASCII(scheme));
DCHECK_EQ(scheme, base::StringToLowerASCII(scheme));
if (scheme::IsInternalHandledScheme(scheme))
return true;
@ -738,14 +738,15 @@ void CefContentBrowserClient::AllowCertificateError(
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
ResourceType::Type resource_type,
content::ResourceType resource_type,
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* result) {
CEF_REQUIRE_UIT();
if (resource_type != ResourceType::MAIN_FRAME) {
if (resource_type != content::ResourceType::RESOURCE_TYPE_MAIN_FRAME) {
// A sub-resource has a certificate error. The user doesn't really
// have a context for making the right decision, so block the request
// hard.
@ -930,7 +931,7 @@ void CefContentBrowserClient::ResourceDispatcherHostCreated() {
void CefContentBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* rvh,
const GURL& url,
WebPreferences* prefs) {
content::WebPreferences* prefs) {
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForHost(rvh);
DCHECK(browser.get());

View File

@ -109,9 +109,10 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
ResourceType::Type resource_type,
content::ResourceType resource_type,
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* result) OVERRIDE;
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
@ -139,7 +140,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
virtual void ResourceDispatcherHostCreated() OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh,
const GURL& url,
WebPreferences* prefs) OVERRIDE;
content::WebPreferences* prefs) OVERRIDE;
virtual SkColor GetBaseBackgroundColor(content::RenderViewHost* rvh) OVERRIDE;
virtual void BrowserURLHandlerCreated(
content::BrowserURLHandler* handler) OVERRIDE;

View File

@ -28,24 +28,61 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "grit/cef_resources.h"
#include "net/socket/tcp_listen_socket.h"
#include "net/socket/tcp_server_socket.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
const char kTargetTypePage[] = "page";
const char kTargetTypeServiceWorker[] = "service_worker";
const char kTargetTypeOther[] = "other";
class TCPServerSocketFactory
: public content::DevToolsHttpHandler::ServerSocketFactory {
public:
TCPServerSocketFactory(const std::string& address, int port, int backlog)
: content::DevToolsHttpHandler::ServerSocketFactory(
address, port, backlog) {}
private:
// content::DevToolsHttpHandler::ServerSocketFactory.
virtual scoped_ptr<net::ServerSocket> Create() const OVERRIDE {
return scoped_ptr<net::ServerSocket>(
new net::TCPServerSocket(NULL, net::NetLog::Source()));
}
DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
};
scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>
CreateSocketFactory(int port) {
return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>(
new TCPServerSocketFactory("127.0.0.1", port, 1));
}
class Target : public content::DevToolsTarget {
public:
explicit Target(content::WebContents* web_contents);
explicit Target(scoped_refptr<content::DevToolsAgentHost> agent_host);
virtual std::string GetId() const OVERRIDE { return id_; }
virtual std::string GetId() const OVERRIDE { return agent_host_->GetId(); }
virtual std::string GetParentId() const OVERRIDE { return std::string(); }
virtual std::string GetType() const OVERRIDE { return kTargetTypePage; }
virtual std::string GetTitle() const OVERRIDE { return title_; }
virtual std::string GetType() const OVERRIDE {
switch (agent_host_->GetType()) {
case content::DevToolsAgentHost::TYPE_WEB_CONTENTS:
return kTargetTypePage;
case content::DevToolsAgentHost::TYPE_SERVICE_WORKER:
return kTargetTypeServiceWorker;
default:
break;
}
return kTargetTypeOther;
}
virtual std::string GetTitle() const OVERRIDE {
return agent_host_->GetTitle();
}
virtual std::string GetDescription() const OVERRIDE { return std::string(); }
virtual GURL GetURL() const OVERRIDE { return url_; }
virtual GURL GetURL() const OVERRIDE { return agent_host_->GetURL(); }
virtual GURL GetFaviconURL() const OVERRIDE { return favicon_url_; }
virtual base::TimeTicks GetLastActivityTime() const OVERRIDE {
return last_activity_time_;
@ -62,45 +99,27 @@ class Target : public content::DevToolsTarget {
private:
scoped_refptr<content::DevToolsAgentHost> agent_host_;
std::string id_;
std::string title_;
GURL url_;
GURL favicon_url_;
base::TimeTicks last_activity_time_;
};
Target::Target(content::WebContents* web_contents) {
agent_host_ =
content::DevToolsAgentHost::GetOrCreateFor(
web_contents->GetRenderViewHost());
id_ = agent_host_->GetId();
title_ = base::UTF16ToUTF8(web_contents->GetTitle());
url_ = web_contents->GetURL();
content::NavigationController& controller = web_contents->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry();
if (entry != NULL && entry->GetURL().is_valid())
favicon_url_ = entry->GetFavicon().url;
last_activity_time_ = web_contents->GetLastActiveTime();
Target::Target(scoped_refptr<content::DevToolsAgentHost> agent_host)
: agent_host_(agent_host) {
if (content::WebContents* web_contents = agent_host_->GetWebContents()) {
content::NavigationController& controller = web_contents->GetController();
content::NavigationEntry* entry = controller.GetActiveEntry();
if (entry != NULL && entry->GetURL().is_valid())
favicon_url_ = entry->GetFavicon().url;
last_activity_time_ = web_contents->GetLastActiveTime();
}
}
bool Target::Activate() const {
content::RenderViewHost* rvh = agent_host_->GetRenderViewHost();
if (!rvh)
return false;
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(rvh);
if (!web_contents)
return false;
web_contents->GetDelegate()->ActivateContents(web_contents);
return true;
return agent_host_->Activate();
}
bool Target::Close() const {
content::RenderViewHost* rvh = agent_host_->GetRenderViewHost();
if (!rvh)
return false;
rvh->ClosePage();
return true;
return agent_host_->Close();
}
} // namespace
@ -109,8 +128,8 @@ bool Target::Close() const {
CefDevToolsDelegate::CefDevToolsDelegate(int port) {
devtools_http_handler_ = content::DevToolsHttpHandler::Start(
new net::TCPListenSocketFactory("127.0.0.1", port),
"",
CreateSocketFactory(port),
std::string(),
this,
base::FilePath());
}
@ -147,14 +166,11 @@ scoped_ptr<content::DevToolsTarget> CefDevToolsDelegate::CreateNewTarget(
void CefDevToolsDelegate::EnumerateTargets(TargetCallback callback) {
TargetList targets;
std::vector<content::RenderViewHost*> rvh_list =
content::DevToolsAgentHost::GetValidRenderViewHosts();
for (std::vector<content::RenderViewHost*>::iterator it = rvh_list.begin();
it != rvh_list.end(); ++it) {
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(*it);
if (web_contents)
targets.push_back(new Target(web_contents));
content::DevToolsAgentHost::List agents =
content::DevToolsAgentHost::GetOrCreateAll();
for (content::DevToolsAgentHost::List::iterator it = agents.begin();
it != agents.end(); ++it) {
targets.push_back(new Target(*it));
}
callback.Run(targets);
}

View File

@ -9,10 +9,11 @@
#include "libcef/browser/request_context_impl.h"
#include "base/command_line.h"
#include "base/json/json_reader.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/devtools_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@ -44,7 +45,7 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
content::DevToolsAgentHost::GetOrCreateFor(
inspected_browser->GetWebContents()->GetRenderViewHost()).get());
inspected_browser->GetWebContents()).get());
// Need to load the URL after creating the DevTools objects.
CefDevToolsDelegate* delegate =
@ -75,9 +76,6 @@ CefDevToolsFrontend::CefDevToolsFrontend(
: WebContentsObserver(frontend_browser->GetWebContents()),
frontend_browser_(frontend_browser),
agent_host_(agent_host) {
frontend_host_.reset(
content::DevToolsClientHost::CreateDevToolsFrontendHost(
web_contents(), this));
}
CefDevToolsFrontend::~CefDevToolsFrontend() {
@ -85,10 +83,11 @@ CefDevToolsFrontend::~CefDevToolsFrontend() {
void CefDevToolsFrontend::RenderViewCreated(
content::RenderViewHost* render_view_host) {
content::DevToolsClientHost::SetupDevToolsFrontendClient(
web_contents()->GetRenderViewHost());
content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(
agent_host_.get(), frontend_host_.get());
if (!frontend_host_) {
frontend_host_.reset(
content::DevToolsFrontendHost::Create(render_view_host, this));
agent_host_->AttachClient(this);
}
}
void CefDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() {
@ -97,11 +96,58 @@ void CefDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() {
}
void CefDevToolsFrontend::WebContentsDestroyed() {
content::DevToolsManager::GetInstance()->ClientHostClosing(
frontend_host_.get());
agent_host_->DetachClient();
delete this;
}
void CefDevToolsFrontend::InspectedContentsClosing() {
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
const std::string& message) {
std::string method;
std::string browser_message;
int id = 0;
base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL;
scoped_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
if (!parsed_message ||
!parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method) ||
!dict->GetList("params", &params)) {
return;
}
if (method != "sendMessageToBrowser" ||
params->GetSize() != 1 ||
!params->GetString(0, &browser_message)) {
return;
}
dict->GetInteger("id", &id);
agent_host_->DispatchProtocolMessage(browser_message);
if (id) {
std::string code = "InspectorFrontendAPI.embedderMessageAck(" +
base::IntToString(id) + ",\"\");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
}
}
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontendToBackend(
const std::string& message) {
agent_host_->DispatchProtocolMessage(message);
}
void CefDevToolsFrontend::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host,
const std::string& message) {
std::string code = "InspectorFrontendAPI.dispatchMessage(" + message + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
}
void CefDevToolsFrontend::AgentHostClosed(
content::DevToolsAgentHost* agent_host,
bool replaced) {
Close();
}

View File

@ -12,8 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_client_host.h"
#include "content/public/browser/devtools_frontend_host_delegate.h"
#include "content/public/browser/devtools_frontend_host.h"
#include "content/public/browser/web_contents_observer.h"
namespace content {
@ -22,7 +21,8 @@ class WebContents;
}
class CefDevToolsFrontend : public content::WebContentsObserver,
public content::DevToolsFrontendHostDelegate {
public content::DevToolsFrontendHost::Delegate,
public content::DevToolsAgentHostClient {
public:
static CefDevToolsFrontend* Show(
CefRefPtr<CefBrowserHostImpl> inspected_browser,
@ -43,20 +43,29 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
content::DevToolsAgentHost* agent_host);
virtual ~CefDevToolsFrontend();
// WebContentsObserver overrides
// WebContentsObserver overrides.
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DocumentOnLoadCompletedInMainFrame() OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
// DevToolsFrontendHostDelegate implementation
virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE {}
// content::DevToolsFrontendHost::Delegate implementation.
virtual void HandleMessageFromDevToolsFrontend(
const std::string& message) OVERRIDE;
virtual void HandleMessageFromDevToolsFrontendToBackend(
const std::string& message) OVERRIDE;
virtual void InspectedContentsClosing() OVERRIDE;
// content::DevToolsAgentHostClient implementation.
virtual void DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host,
const std::string& message) OVERRIDE;
virtual void AgentHostClosed(
content::DevToolsAgentHost* agent_host,
bool replaced) OVERRIDE;
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
scoped_refptr<content::DevToolsAgentHost> agent_host_;
scoped_ptr<content::DevToolsClientHost> frontend_host_;
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
DISALLOW_COPY_AND_ASSIGN(CefDevToolsFrontend);
};

View File

@ -103,10 +103,10 @@ void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged() {
void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
int render_process_id,
int render_view_id,
int render_frame_id,
int page_request_id,
const GURL& security_origin,
const content::MediaStreamDevice& device,
content::MediaStreamType stream_type,
content::MediaRequestState state) {
}

View File

@ -46,10 +46,10 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
virtual void OnVideoCaptureDevicesChanged() OVERRIDE;
virtual void OnMediaRequestStateChanged(
int render_process_id,
int render_view_id,
int render_frame_id,
int page_request_id,
const GURL& security_origin,
const content::MediaStreamDevice& device,
content::MediaStreamType stream_type,
content::MediaRequestState state) OVERRIDE;
virtual void OnCreatingAudioStream(int render_process_id,
int render_view_id) OVERRIDE;

View File

@ -22,7 +22,8 @@ CefMenuCreatorRunnerLinux::~CefMenuCreatorRunnerLinux() {
}
bool CefMenuCreatorRunnerLinux::RunContextMenu(CefMenuCreator* manager) {
menu_.reset(new views::MenuRunner(manager->model()));
menu_.reset(
new views::MenuRunner(manager->model(), views::MenuRunner::CONTEXT_MENU));
gfx::Point screen_point;
@ -57,8 +58,7 @@ bool CefMenuCreatorRunnerLinux::RunContextMenu(CefMenuCreator* manager) {
menu_->RunMenuAt(manager->browser()->window_widget(),
NULL, gfx::Rect(screen_point, gfx::Size()),
views::MENU_ANCHOR_TOPRIGHT,
ui::MENU_SOURCE_NONE,
views::MenuRunner::CONTEXT_MENU);
ui::MENU_SOURCE_NONE);
UNUSED(result);
return true;
@ -74,4 +74,3 @@ bool CefMenuCreatorRunnerLinux::FormatLabel(base::string16& label) {
const char16 replace[] = {L'&', 0};
return base::ReplaceChars(label, replace, base::string16(), &label);
}

View File

@ -18,13 +18,13 @@
#include "chrome/browser/printing/printer_query.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/print_messages.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "grit/generated_resources.h"
#include "printing/metafile_impl.h"
#include "printing/printed_document.h"
#include "ui/base/l10n/l10n_util.h"
@ -57,7 +57,7 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
inside_inner_message_loop_(false),
cookie_(0),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
DCHECK(queue_.get());
#if (defined(OS_POSIX) && !defined(OS_MACOSX)) || \
defined(WIN_PDF_METAFILE_FOR_PRINTING)
expecting_first_page_ = true;
@ -128,6 +128,9 @@ void PrintViewManagerBase::OnPdfToEmfConverted(
const PrintHostMsg_DidPrintPage_Params& params,
double scale_factor,
const std::vector<base::FilePath>& emf_files) {
if (!print_job_.get())
return;
PrintedDocument* document = print_job_->document();
if (!document)
return;
@ -526,12 +529,12 @@ bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
// The job was initiated by a script. Time to get the corresponding worker
// thread.
scoped_refptr<PrinterQuery> queued_query = queue_->PopPrinterQuery(cookie);
if (!queued_query) {
if (!queued_query.get()) {
NOTREACHED();
return false;
}
if (!CreateNewPrintJob(queued_query)) {
if (!CreateNewPrintJob(queued_query.get())) {
// Don't kill anything.
return false;
}
@ -568,7 +571,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
scoped_refptr<printing::PrinterQuery> printer_query;
printer_query = queue_->PopPrinterQuery(cookie);
if (!printer_query)
if (!printer_query.get())
return;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,

View File

@ -8,20 +8,20 @@
#include "base/bind.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/printing/printing_ui_web_contents_observer.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/common/print_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/child_process_host.h"
#if defined(OS_CHROMEOS)
#include <fcntl.h>
#include <map>
#include "base/file_util.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "chrome/browser/printing/print_dialog_cloud.h"
#endif
@ -34,6 +34,8 @@
using content::BrowserThread;
namespace printing {
namespace {
#if defined(OS_CHROMEOS)
@ -49,7 +51,7 @@ static base::LazyInstance<PrintingSequencePathMap>
g_printing_file_descriptor_map = LAZY_INSTANCE_INITIALIZER;
#endif
void RenderParamsFromPrintSettings(const printing::PrintSettings& settings,
void RenderParamsFromPrintSettings(const PrintSettings& settings,
PrintMsg_Print_Params* params) {
params->page_size = settings.page_setup_device_units().physical_size();
params->content_size.SetSize(
@ -85,7 +87,7 @@ PrintingMessageFilter::PrintingMessageFilter(int render_process_id)
: content::BrowserMessageFilter(PrintMsgStart),
render_process_id_(render_process_id),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
DCHECK(queue_.get());
}
PrintingMessageFilter::~PrintingMessageFilter() {
@ -174,8 +176,8 @@ void PrintingMessageFilter::OnAllocateTempFileForPrinting(
content::WebContents* wc = GetWebContentsForRenderView(render_view_id);
if (!wc)
return;
printing::PrintViewManagerBasic* print_view_manager =
printing::PrintViewManagerBasic::FromWebContents(wc);
PrintViewManagerBasic* print_view_manager =
PrintViewManagerBasic::FromWebContents(wc);
// The file descriptor is originally created in & passed from the Android
// side, and it will handle the closing.
const base::FileDescriptor& file_descriptor =
@ -208,11 +210,11 @@ void PrintingMessageFilter::OnTempFileForPrintingWritten(int render_view_id,
content::WebContents* wc = GetWebContentsForRenderView(render_view_id);
if (!wc)
return;
printing::PrintViewManagerBasic* print_view_manager =
printing::PrintViewManagerBasic::FromWebContents(wc);
PrintViewManagerBasic* print_view_manager =
PrintViewManagerBasic::FromWebContents(wc);
const base::FileDescriptor& file_descriptor =
print_view_manager->file_descriptor();
printing::PrintingContextAndroid::PdfWritingDone(file_descriptor.fd, true);
PrintingContextAndroid::PdfWritingDone(file_descriptor.fd, true);
// Invalidate the file descriptor so it doesn't accidentally get reused.
print_view_manager->set_file_descriptor(base::FileDescriptor(-1, false));
#endif
@ -244,46 +246,6 @@ content::WebContents* PrintingMessageFilter::GetWebContentsForRenderView(
return view ? content::WebContents::FromRenderViewHost(view) : NULL;
}
struct PrintingMessageFilter::GetPrintSettingsForRenderViewParams {
printing::PrinterQuery::GetSettingsAskParam ask_user_for_settings;
int expected_page_count;
bool has_selection;
printing::MarginType margin_type;
};
void PrintingMessageFilter::GetPrintSettingsForRenderView(
int render_view_id,
GetPrintSettingsForRenderViewParams params,
const base::Closure& callback,
scoped_refptr<printing::PrinterQuery> printer_query) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::WebContents* wc = GetWebContentsForRenderView(render_view_id);
if (wc) {
scoped_ptr<PrintingUIWebContentsObserver> wc_observer(
new PrintingUIWebContentsObserver(wc));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&printing::PrinterQuery::GetSettings, printer_query,
params.ask_user_for_settings, base::Passed(&wc_observer),
params.expected_page_count, params.has_selection,
params.margin_type, callback));
} else {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&PrintingMessageFilter::OnGetPrintSettingsFailed, this,
callback, printer_query));
}
}
void PrintingMessageFilter::OnGetPrintSettingsFailed(
const base::Closure& callback,
scoped_refptr<printing::PrinterQuery> printer_query) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
printer_query->GetSettingsDone(printing::PrintSettings(),
printing::PrintingContext::FAILED);
callback.Run();
}
void PrintingMessageFilter::OnIsPrintingEnabled(bool* is_enabled) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
*is_enabled = true;
@ -291,33 +253,32 @@ void PrintingMessageFilter::OnIsPrintingEnabled(bool* is_enabled) {
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
scoped_refptr<printing::PrinterQuery> printer_query;
scoped_refptr<PrinterQuery> printer_query;
printer_query = queue_->PopPrinterQuery(0);
if (!printer_query)
printer_query = queue_->CreatePrinterQuery();
if (!printer_query.get()) {
printer_query =
queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
}
// Loads default settings. This is asynchronous, only the IPC message sender
// will hang until the settings are retrieved.
GetPrintSettingsForRenderViewParams params;
params.ask_user_for_settings = printing::PrinterQuery::DEFAULTS;
params.expected_page_count = 0;
params.has_selection = false;
params.margin_type = printing::DEFAULT_MARGINS;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&PrintingMessageFilter::GetPrintSettingsForRenderView, this,
reply_msg->routing_id(), params,
base::Bind(&PrintingMessageFilter::OnGetDefaultPrintSettingsReply,
this, printer_query, reply_msg),
printer_query));
printer_query->GetSettings(
PrinterQuery::DEFAULTS,
0,
false,
DEFAULT_MARGINS,
base::Bind(&PrintingMessageFilter::OnGetDefaultPrintSettingsReply,
this,
printer_query,
reply_msg));
}
void PrintingMessageFilter::OnGetDefaultPrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_Print_Params params;
if (!printer_query.get() ||
printer_query->last_status() != printing::PrintingContext::OK) {
printer_query->last_status() != PrintingContext::OK) {
params.Reset();
} else {
RenderParamsFromPrintSettings(printer_query->settings(), &params);
@ -339,27 +300,25 @@ void PrintingMessageFilter::OnGetDefaultPrintSettingsReply(
void PrintingMessageFilter::OnScriptedPrint(
const PrintHostMsg_ScriptedPrint_Params& params,
IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query =
scoped_refptr<PrinterQuery> printer_query =
queue_->PopPrinterQuery(params.cookie);
if (!printer_query)
printer_query = queue_->CreatePrinterQuery();
GetPrintSettingsForRenderViewParams settings_params;
settings_params.ask_user_for_settings = printing::PrinterQuery::ASK_USER;
settings_params.expected_page_count = params.expected_pages_count;
settings_params.has_selection = params.has_selection;
settings_params.margin_type = params.margin_type;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&PrintingMessageFilter::GetPrintSettingsForRenderView, this,
reply_msg->routing_id(), settings_params,
base::Bind(&PrintingMessageFilter::OnScriptedPrintReply, this,
printer_query, reply_msg),
printer_query));
if (!printer_query.get()) {
printer_query =
queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id());
}
printer_query->GetSettings(
PrinterQuery::ASK_USER,
params.expected_pages_count,
params.has_selection,
params.margin_type,
base::Bind(&PrintingMessageFilter::OnScriptedPrintReply,
this,
printer_query,
reply_msg));
}
void PrintingMessageFilter::OnScriptedPrintReply(
scoped_refptr<printing::PrinterQuery> printer_query,
scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
#if defined(OS_ANDROID)
@ -367,14 +326,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
// |reply_msg| before we can get the routing ID for the Android code.
int routing_id = reply_msg->routing_id();
#endif
if (printer_query->last_status() != printing::PrintingContext::OK ||
if (printer_query->last_status() != PrintingContext::OK ||
!printer_query->settings().dpi()) {
params.Reset();
} else {
RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
params.params.document_cookie = printer_query->cookie();
params.pages =
printing::PageRange::GetPages(printer_query->settings().ranges());
params.pages = PageRange::GetPages(printer_query->settings().ranges());
}
PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params);
Send(reply_msg);
@ -401,8 +359,8 @@ void PrintingMessageFilter::UpdateFileDescriptor(int render_view_id, int fd) {
content::WebContents* wc = GetWebContentsForRenderView(render_view_id);
if (!wc)
return;
printing::PrintViewManagerBasic* print_view_manager =
printing::PrintViewManagerBasic::FromWebContents(wc);
PrintViewManagerBasic* print_view_manager =
PrintViewManagerBasic::FromWebContents(wc);
print_view_manager->set_file_descriptor(base::FileDescriptor(fd, false));
}
#endif
@ -410,30 +368,45 @@ void PrintingMessageFilter::UpdateFileDescriptor(int render_view_id, int fd) {
void PrintingMessageFilter::OnUpdatePrintSettings(
int document_cookie, const base::DictionaryValue& job_settings,
IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query;
scoped_ptr<base::DictionaryValue> new_settings(job_settings.DeepCopy());
scoped_refptr<PrinterQuery> printer_query;
printer_query = queue_->PopPrinterQuery(document_cookie);
if (!printer_query)
printer_query = queue_->CreatePrinterQuery();
if (!printer_query.get()) {
int host_id = render_process_id_;
int routing_id = reply_msg->routing_id();
if (!new_settings->GetInteger(printing::kPreviewInitiatorHostId,
&host_id) ||
!new_settings->GetInteger(printing::kPreviewInitiatorRoutingId,
&routing_id)) {
host_id = content::ChildProcessHost::kInvalidUniqueID;
routing_id = content::ChildProcessHost::kInvalidUniqueID;
}
printer_query = queue_->CreatePrinterQuery(host_id, routing_id);
}
printer_query->SetSettings(
job_settings,
new_settings.Pass(),
base::Bind(&PrintingMessageFilter::OnUpdatePrintSettingsReply, this,
printer_query, reply_msg));
}
void PrintingMessageFilter::OnUpdatePrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
if (!printer_query.get() ||
printer_query->last_status() != printing::PrintingContext::OK) {
printer_query->last_status() != PrintingContext::OK) {
params.Reset();
} else {
RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
params.params.document_cookie = printer_query->cookie();
params.pages =
printing::PageRange::GetPages(printer_query->settings().ranges());
params.pages = PageRange::GetPages(printer_query->settings().ranges());
}
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params);
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(
reply_msg,
params,
printer_query &&
(printer_query->last_status() == printing::PrintingContext::CANCEL));
Send(reply_msg);
// If user hasn't cancelled.
if (printer_query.get()) {
@ -444,3 +417,5 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
}
}
}
} // namespace printing

View File

@ -26,10 +26,10 @@ class WebContents;
}
namespace printing {
class PrinterQuery;
class PrintJobManager;
class PrintQueriesQueue;
}
class PrinterQuery;
// This class filters out incoming printing related IPC messages for the
// renderer process on the IPC thread.
@ -81,35 +81,21 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
// to base::Bind.
struct GetPrintSettingsForRenderViewParams;
// Retrieve print settings. Uses |render_view_id| to get a parent
// for any UI created if needed.
void GetPrintSettingsForRenderView(
int render_view_id,
GetPrintSettingsForRenderViewParams params,
const base::Closure& callback,
scoped_refptr<printing::PrinterQuery> printer_query);
void OnGetPrintSettingsFailed(
const base::Closure& callback,
scoped_refptr<printing::PrinterQuery> printer_query);
// Checks if printing is enabled.
void OnIsPrintingEnabled(bool* is_enabled);
// Get the default print setting.
void OnGetDefaultPrintSettings(IPC::Message* reply_msg);
void OnGetDefaultPrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
IPC::Message* reply_msg);
void OnGetDefaultPrintSettingsReply(scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg);
// The renderer host have to show to the user the print dialog and returns
// the selected print settings. The task is handled by the print worker
// thread and the UI thread. The reply occurs on the IO thread.
void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params,
IPC::Message* reply_msg);
void OnScriptedPrintReply(
scoped_refptr<printing::PrinterQuery> printer_query,
IPC::Message* reply_msg);
void OnScriptedPrintReply(scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg);
// Modify the current print settings based on |job_settings|. The task is
// handled by the print worker thread and the UI thread. The reply occurs on
@ -117,15 +103,16 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
void OnUpdatePrintSettings(int document_cookie,
const base::DictionaryValue& job_settings,
IPC::Message* reply_msg);
void OnUpdatePrintSettingsReply(
scoped_refptr<printing::PrinterQuery> printer_query,
IPC::Message* reply_msg);
void OnUpdatePrintSettingsReply(scoped_refptr<PrinterQuery> printer_query,
IPC::Message* reply_msg);
const int render_process_id_;
scoped_refptr<printing::PrintQueriesQueue> queue_;
scoped_refptr<PrintQueriesQueue> queue_;
DISALLOW_COPY_AND_ASSIGN(PrintingMessageFilter);
};
} // namespace printing
#endif // CEF_LIBCEF_BROWSER_PRINTING_PRINTING_MESSAGE_FILTER_H_

View File

@ -68,6 +68,10 @@ class CefRootLayer : public ui::Layer, public ui::LayerDelegate {
virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
}
virtual void OnDelegatedFrameDamage(
const gfx::Rect& damage_rect_in_dip) OVERRIDE {
}
virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
}
@ -172,7 +176,9 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
#if !defined(OS_MACOSX)
// On OS X the ui::Compositor is created/owned by the platform view.
compositor_.reset(
new ui::Compositor(compositor_widget_, content::GetContextFactory()));
new ui::Compositor(compositor_widget_,
content::GetContextFactory(),
base::MessageLoopProxy::current()));
#endif
compositor_->SetRootLayer(root_layer_.get());
@ -185,9 +191,16 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
}
CefRenderWidgetHostViewOSR::~CefRenderWidgetHostViewOSR() {
// Marking the DelegatedFrameHost as removed from the window hierarchy is
// necessary to remove all connections to its old ui::Compositor.
if (is_showing_)
delegated_frame_host_->WasHidden();
delegated_frame_host_->RemovingFromWindow();
PlatformDestroyCompositorWidget();
delegated_frame_host_.reset(NULL);
compositor_.reset(NULL);
PlatformDestroyCompositorWidget();
root_layer_.reset(NULL);
}
@ -341,9 +354,9 @@ void CefRenderWidgetHostViewOSR::WasShown() {
is_showing_ = true;
if (render_widget_host_)
render_widget_host_->WasShown();
render_widget_host_->WasShown(ui::LatencyInfo());
delegated_frame_host_->AddedToWindow();
delegated_frame_host_->WasShown();
delegated_frame_host_->WasShown(ui::LatencyInfo());
}
void CefRenderWidgetHostViewOSR::WasHidden() {
@ -472,21 +485,13 @@ void CefRenderWidgetHostViewOSR::SelectionBoundsChanged(
const ViewHostMsg_SelectionBounds_Params& params) {
}
void CefRenderWidgetHostViewOSR::ScrollOffsetChanged() {
if (!browser_impl_)
return;
browser_impl_->GetClient()->GetRenderHandler()->
OnScrollOffsetChanged(browser_impl_.get());
}
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurface(
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback,
const SkBitmap::Config config) {
const SkColorType color_type) {
delegated_frame_host_->CopyFromCompositingSurface(
src_subrect, dst_size, callback, config);
src_subrect, dst_size, callback, color_type);
}
void CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceToVideoFrame(
@ -596,6 +601,12 @@ gfx::GLSurfaceHandle CefRenderWidgetHostViewOSR::GetCompositingSurface() {
GetSharedSurfaceHandle();
}
content::BrowserAccessibilityManager*
CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate) {
return NULL;
}
#if !defined(OS_MACOSX) && defined(USE_AURA)
void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
const gfx::Range& range,
@ -615,11 +626,6 @@ content::RenderWidgetHostImpl* CefRenderWidgetHostViewOSR::GetHost() {
return render_widget_host_;
}
void CefRenderWidgetHostViewOSR::SchedulePaintInRect(
const gfx::Rect& damage_rect_in_dip) {
root_layer_->SchedulePaint(damage_rect_in_dip);
}
bool CefRenderWidgetHostViewOSR::IsVisible() {
return IsShowing();
}
@ -909,13 +915,11 @@ void CefRenderWidgetHostViewOSR::PrepareTextureCopyOutputResult(
bitmap_size.height() != result_size.height()) {
// Create a new bitmap if the size has changed.
bitmap_.reset(new SkBitmap);
bitmap_->setConfig(SkBitmap::kARGB_8888_Config,
result_size.width(),
result_size.height(),
0,
kOpaque_SkAlphaType);
if (!bitmap_->allocPixels())
if (!bitmap_->allocN32Pixels(result_size.width(),
result_size.height(),
true)) {
return;
}
}
content::ImageTransportFactory* factory =
@ -944,7 +948,7 @@ void CefRenderWidgetHostViewOSR::PrepareTextureCopyOutputResult(
gfx::Rect(result_size),
result_size,
pixels,
SkBitmap::kARGB_8888_Config,
kN32_SkColorType,
base::Bind(
&CefRenderWidgetHostViewOSR::CopyFromCompositingSurfaceFinishedProxy,
weak_ptr_factory_.GetWeakPtr(),

View File

@ -17,6 +17,10 @@
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "ui/compositor/compositor.h"
#if defined(OS_MACOSX)
#include "content/browser/compositor/browser_compositor_view_mac.h"
#endif
#if defined(OS_WIN)
#include "ui/gfx/win/window_impl.h"
#endif
@ -32,8 +36,10 @@ class CefWebContentsViewOSR;
#if defined(OS_MACOSX)
#ifdef __OBJC__
@class CALayer;
@class NSWindow;
#else
class CALayer;
class NSWindow;
#endif
#endif
@ -62,6 +68,9 @@ class CefWindowX11;
class CefRenderWidgetHostViewOSR
: public content::RenderWidgetHostViewBase,
#if defined(OS_MACOSX)
public content::BrowserCompositorViewMacClient,
#endif
public content::DelegatedFrameHostClient {
public:
explicit CefRenderWidgetHostViewOSR(content::RenderWidgetHost* widget);
@ -128,12 +137,11 @@ class CefRenderWidgetHostViewOSR
virtual gfx::Size GetPhysicalBackingSize() const OVERRIDE;
virtual void SelectionBoundsChanged(
const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE;
virtual void ScrollOffsetChanged() OVERRIDE;
virtual void CopyFromCompositingSurface(
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback,
const SkBitmap::Config config) OVERRIDE;
const SkColorType color_type) OVERRIDE;
virtual void CopyFromCompositingSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
const scoped_refptr<media::VideoFrame>& target,
@ -158,6 +166,9 @@ class CefRenderWidgetHostViewOSR
virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
virtual content::BrowserAccessibilityManager*
CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate) OVERRIDE;
#if defined(OS_MACOSX)
virtual bool PostProcessEventForPluginIme(
@ -176,12 +187,19 @@ class CefRenderWidgetHostViewOSR
virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE;
#endif
// DelegatedFrameHost implementation.
#if defined(OS_MACOSX)
// BrowserCompositorViewMacClient implementation.
virtual bool BrowserCompositorViewShouldAckImmediately() const OVERRIDE;
virtual void BrowserCompositorViewFrameSwapped(
const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE;
virtual NSView* BrowserCompositorSuperview() OVERRIDE;
virtual ui::Layer* BrowserCompositorRootLayer() OVERRIDE;
#endif // defined(OS_MACOSX)
// DelegatedFrameHostClient implementation.
virtual ui::Compositor* GetCompositor() const OVERRIDE;
virtual ui::Layer* GetLayer() OVERRIDE;
virtual content::RenderWidgetHostImpl* GetHost() OVERRIDE;
virtual void SchedulePaintInRect(
const gfx::Rect& damage_rect_in_dip) OVERRIDE;
virtual bool IsVisible() OVERRIDE;
virtual scoped_ptr<content::ResizeLock> CreateResizeLock(
bool defer_compositor_lock) OVERRIDE;
@ -295,6 +313,8 @@ class CefRenderWidgetHostViewOSR
scoped_ptr<gfx::WindowImpl> window_;
#elif defined(OS_MACOSX)
NSWindow* window_;
CALayer* background_layer_;
scoped_ptr<content::BrowserCompositorViewMac> compositor_view_;
#elif defined(USE_X11)
CefWindowX11* window_;
#endif

View File

@ -10,7 +10,8 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/text_input_client_osr_mac.h"
#include "content/browser/compositor/browser_compositor_view_private_mac.h"
#include "content/browser/compositor/browser_compositor_view_mac.h"
#include "ui/events/latency_info.h"
#if !defined(UNUSED)
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
@ -86,6 +87,30 @@ void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
client->composition_bounds_ = character_bounds;
}
bool CefRenderWidgetHostViewOSR::BrowserCompositorViewShouldAckImmediately()
const {
return false;
}
void CefRenderWidgetHostViewOSR::BrowserCompositorViewFrameSwapped(
const std::vector<ui::LatencyInfo>& all_latency_info) {
if (!render_widget_host_)
return;
for (auto latency_info : all_latency_info) {
latency_info.AddLatencyNumber(
ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0);
render_widget_host_->FrameSwapped(latency_info);
}
}
NSView* CefRenderWidgetHostViewOSR::BrowserCompositorSuperview() {
return [window_ contentView];
}
ui::Layer* CefRenderWidgetHostViewOSR::BrowserCompositorRootLayer() {
return root_layer_.get();
}
CefTextInputContext CefRenderWidgetHostViewOSR::GetNSTextInputContext() {
if (!text_input_context_osr_mac_) {
CefTextInputClientOSRMac* text_input_client_osr_mac =
@ -260,21 +285,30 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO];
BrowserCompositorViewCocoa* view = [[BrowserCompositorViewCocoa alloc] init];
[window_ setContentView:view];
compositor_.reset([view compositor]);
// Create a CALayer which is used by BrowserCompositorViewMac for rendering.
background_layer_ = [[[CALayer alloc] init] retain];
[background_layer_ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
NSView* content_view = [window_ contentView];
[content_view setLayer:background_layer_];
[content_view setWantsLayer:YES];
compositor_view_.reset(new content::BrowserCompositorViewMac(this));
compositor_.reset(compositor_view_->GetCompositor());
DCHECK(compositor_);
compositor_widget_ = view;
}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
DCHECK(window_);
// Compositor is owned by and will be freed by BrowserCompositorViewCocoa.
// Compositor is owned by and will be freed by BrowserCompositorViewMac.
ui::Compositor* compositor = compositor_.release();
UNUSED(compositor);
[window_ close];
window_ = nil;
compositor_widget_ = gfx::kNullAcceleratedWidget;
[background_layer_ release];
background_layer_ = nil;
compositor_view_.reset(NULL);
}

View File

@ -62,12 +62,10 @@ void CefResourceDispatcherHostDelegate::RequestBeginning(
net::URLRequest* request,
content::ResourceContext* resource_context,
content::AppCacheService* appcache_service,
ResourceType::Type resource_type,
int child_id,
int route_id,
content::ResourceType resource_type,
ScopedVector<content::ResourceThrottle>* throttles) {
if (resource_type == ResourceType::MAIN_FRAME ||
resource_type == ResourceType::SUB_FRAME) {
if (resource_type == content::ResourceType::RESOURCE_TYPE_MAIN_FRAME ||
resource_type == content::ResourceType::RESOURCE_TYPE_SUB_FRAME) {
int64 frame_id = -1;
// ResourceRequestInfo will not exist for requests originating from
@ -94,8 +92,7 @@ void CefResourceDispatcherHostDelegate::RequestBeginning(
bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
const GURL& url,
int child_id,
int route_id,
bool initiated_by_user_gesture) {
int route_id) {
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForView(child_id, route_id);
if (browser.get())

View File

@ -21,14 +21,11 @@ class CefResourceDispatcherHostDelegate
net::URLRequest* request,
content::ResourceContext* resource_context,
content::AppCacheService* appcache_service,
ResourceType::Type resource_type,
int child_id,
int route_id,
content::ResourceType resource_type,
ScopedVector<content::ResourceThrottle>* throttles) OVERRIDE;
virtual bool HandleExternalProtocol(const GURL& url,
int child_id,
int route_id,
bool initiated_by_user_gesture) OVERRIDE;
int route_id) OVERRIDE;
virtual void OnRequestRedirected(
const GURL& redirect_url,
net::URLRequest* request,

View File

@ -44,7 +44,7 @@ void ExtractUnderlines(NSAttributedString* string,
[colorAttr colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
}
underlines->push_back(blink::WebCompositionUnderline(
range.location, NSMaxRange(range), color, [style intValue] > 1));
range.location, NSMaxRange(range), color, [style intValue] > 1, 0));
}
i = range.location + range.length;
}
@ -151,7 +151,7 @@ extern "C" {
} else {
// Use a thin black underline by default.
underlines_.push_back(blink::WebCompositionUnderline(0, length,
SK_ColorBLACK, false));
SK_ColorBLACK, false, 0));
}
// If we are handling a key down event, then SetComposition() will be

View File

@ -41,7 +41,9 @@ bool CefTraceSubscriber::BeginTracing(
done_callback = base::Bind(&CefCompletionCallback::OnComplete, callback);
TracingController::GetInstance()->EnableRecording(
categories, TracingController::DEFAULT_OPTIONS, done_callback);
base::debug::CategoryFilter(categories),
base::debug::TraceOptions(),
done_callback);
return true;
}

View File

@ -44,8 +44,8 @@
#include "net/http/http_util.h"
#include "net/http/transport_security_state.h"
#include "net/proxy/proxy_service.h"
#include "net/ssl/default_server_bound_cert_store.h"
#include "net/ssl/server_bound_cert_service.h"
#include "net/ssl/channel_id_service.h"
#include "net/ssl/default_channel_id_store.h"
#include "net/ssl/ssl_config_service_defaults.h"
#include "url/url_constants.h"
#include "net/url_request/http_user_agent_settings.h"
@ -141,8 +141,8 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() {
storage_->set_network_delegate(new CefNetworkDelegate);
storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
new net::DefaultServerBoundCertStore(NULL),
storage_->set_channel_id_service(new net::ChannelIDService(
new net::DefaultChannelIDStore(NULL),
base::WorkerPool::GetTaskRunner(true)));
storage_->set_http_user_agent_settings(
new CefHttpUserAgentSettings("en-us,en"));
@ -201,8 +201,8 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() {
url_request_context_->cert_verifier();
network_session_params.transport_security_state =
url_request_context_->transport_security_state();
network_session_params.server_bound_cert_service =
url_request_context_->server_bound_cert_service();
network_session_params.channel_id_service =
url_request_context_->channel_id_service();
network_session_params.proxy_service =
url_request_context_->proxy_service();
network_session_params.ssl_config_service =

View File

@ -151,7 +151,7 @@ void CefURLRequestContextProxy::Initialize(
set_host_resolver(context->host_resolver());
set_cert_verifier(context->cert_verifier());
set_transport_security_state(context->transport_security_state());
set_server_bound_cert_service(context->server_bound_cert_service());
set_channel_id_service(context->channel_id_service());
set_fraudulent_certificate_reporter(
context->fraudulent_certificate_reporter());
set_proxy_service(context->proxy_service());

View File

@ -96,20 +96,13 @@ void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {
}
#if defined(OS_MACOSX)
void CefWebContentsViewOSR::SetAllowOverlappingViews(bool overlapping) {
void CefWebContentsViewOSR::SetAllowOtherViews(bool allow) {
}
bool CefWebContentsViewOSR::GetAllowOverlappingViews() const {
bool CefWebContentsViewOSR::GetAllowOtherViews() const {
return false;
}
void CefWebContentsViewOSR::SetOverlayView(
content::WebContentsView* overlay,
const gfx::Point& offset) {
}
void CefWebContentsViewOSR::RemoveOverlayView() {
}
bool CefWebContentsViewOSR::IsEventTracking() const {
return false;
}

View File

@ -48,11 +48,8 @@ class CefWebContentsViewOSR : public content::WebContentsView,
virtual void SetOverscrollControllerEnabled(bool enabled) OVERRIDE;
#if defined(OS_MACOSX)
virtual void SetAllowOverlappingViews(bool overlapping) OVERRIDE;
virtual bool GetAllowOverlappingViews() const OVERRIDE;
virtual void SetOverlayView(content::WebContentsView* overlay,
const gfx::Point& offset) OVERRIDE;
virtual void RemoveOverlayView() OVERRIDE;
virtual void SetAllowOtherViews(bool allow) OVERRIDE;
virtual bool GetAllowOtherViews() const OVERRIDE;
virtual bool IsEventTracking() const OVERRIDE;
virtual void CloseTabAfterEventTracking() OVERRIDE;
#endif

View File

@ -6,7 +6,7 @@
#define CEF_LIBCEF_COMMON_BREAKPAD_CLIENT_H_
#include "base/compiler_specific.h"
#include "components/breakpad/app/breakpad_client.h"
#include "components/crash/app/breakpad_client.h"
class CefBreakpadClient : public breakpad::BreakpadClient {
public:

View File

@ -202,28 +202,6 @@ IPC_MESSAGE_ROUTED1(CefHostMsg_ResponseAck,
int /* request_id */)
// Pepper PDF plugin messages excerpted from chrome/common/render_messages.h.
// Including all of render_messages.h would bring in a number of chrome
// dependencies that are better off avoided.
// The currently displayed PDF has an unsupported feature.
IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_PDFHasUnsupportedFeature)
// Brings up SaveAs... dialog to save specified URL.
IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_PDFSaveURLAs,
GURL /* url */,
content::Referrer /* referrer */)
// Updates the content restrictions, i.e. to disable print/copy.
IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_PDFUpdateContentRestrictions,
int /* restrictions */)
// Brings up a Password... dialog for protected documents.
IPC_SYNC_MESSAGE_ROUTED1_1(ChromeViewHostMsg_PDFModalPromptForPassword,
std::string /* prompt */,
std::string /* actual_value */)
// Singly-included section for struct and custom IPC traits.
#ifndef CEF_LIBCEF_COMMON_CEF_MESSAGES_H_
#define CEF_LIBCEF_COMMON_CEF_MESSAGES_H_

View File

@ -34,19 +34,19 @@
#if defined(OS_WIN)
#include <Objbase.h> // NOLINT(build/include_order)
#include "components/breakpad/app/breakpad_win.h"
#include "components/crash/app/breakpad_win.h"
#endif
#if defined(OS_MACOSX)
#include "base/mac/os_crash_dumps.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "components/breakpad/app/breakpad_mac.h"
#include "components/crash/app/breakpad_mac.h"
#include "content/public/common/content_paths.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include "components/breakpad/app/breakpad_linux.h"
#include "components/crash/app/breakpad_linux.h"
#endif
namespace {
@ -541,8 +541,10 @@ void CefMainDelegate::InitializeResourceBundle() {
DCHECK(!locale.empty());
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(locale,
&content_client_);
ui::ResourceBundle::InitSharedInstanceWithLocale(
locale,
&content_client_,
ui::ResourceBundle::LOAD_COMMON_RESOURCES);
ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance();
if (!content_client_.pack_loading_disabled()) {

View File

@ -12,6 +12,7 @@
#include "base/logging.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/common/resource_type.h"
#include "net/base/upload_data_stream.h"
#include "net/base/upload_element_reader.h"
#include "net/base/upload_bytes_element_reader.h"
@ -23,7 +24,6 @@
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLError.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "webkit/common/resource_type.h"
namespace {
@ -313,9 +313,6 @@ void CefRequestImpl::Set(const blink::WebURLRequest& request) {
flags_ |= UR_FLAG_REPORT_RAW_HEADERS;
first_party_for_cookies_ = request.firstPartyForCookies().spec().utf16();
resource_type_ = static_cast<cef_resource_type_t>(
::ResourceType::FromTargetType(request.targetType()));
}
void CefRequestImpl::Get(blink::WebURLRequest& request) {
@ -327,7 +324,6 @@ void CefRequestImpl::Get(blink::WebURLRequest& request) {
std::string method(method_);
request.setHTTPMethod(blink::WebString::fromUTF8(method.c_str()));
request.setTargetType(blink::WebURLRequest::TargetIsMainFrame);
blink::WebHTTPBody body;
if (postdata_.get()) {

View File

@ -5,12 +5,13 @@
#ifndef CEF_LIBCEF_COMMON_UPLOAD_DATA_H_
#define CEF_LIBCEF_COMMON_UPLOAD_DATA_H_
#include "libcef/common/upload_element.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;

View File

@ -0,0 +1,25 @@
// 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/common/upload_element.h"
#include <algorithm>
#include "net/base/file_stream.h"
#include "net/base/net_errors.h"
namespace net {
UploadElement::UploadElement()
: type_(TYPE_BYTES),
bytes_start_(NULL),
bytes_length_(0),
file_range_offset_(0),
file_range_length_(kuint64max) {
}
UploadElement::~UploadElement() {
}
} // namespace net

View File

@ -0,0 +1,110 @@
// 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_ELEMENT_H_
#define CEF_LIBCEF_COMMON_UPLOAD_ELEMENT_H_
#include <vector>
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
namespace net {
// A class representing an element contained by UploadData.
class NET_EXPORT UploadElement {
public:
enum Type {
TYPE_BYTES,
TYPE_FILE,
};
UploadElement();
~UploadElement();
Type type() const { return type_; }
const char* bytes() const { return bytes_start_ ? bytes_start_ : &buf_[0]; }
uint64 bytes_length() const { return buf_.size() + bytes_length_; }
const base::FilePath& file_path() const { return file_path_; }
uint64 file_range_offset() const { return file_range_offset_; }
uint64 file_range_length() const { return file_range_length_; }
// If NULL time is returned, we do not do the check.
const base::Time& expected_file_modification_time() const {
return expected_file_modification_time_;
}
void SetToBytes(const char* bytes, int bytes_len) {
type_ = TYPE_BYTES;
buf_.assign(bytes, bytes + bytes_len);
}
// This does not copy the given data and the caller should make sure
// the data is secured somewhere else (e.g. by attaching the data
// using SetUserData).
void SetToSharedBytes(const char* bytes, int bytes_len) {
type_ = TYPE_BYTES;
bytes_start_ = bytes;
bytes_length_ = bytes_len;
}
void SetToFilePath(const base::FilePath& path) {
SetToFilePathRange(path, 0, kuint64max, base::Time());
}
// If expected_modification_time is NULL, we do not check for the file
// change. Also note that the granularity for comparison is time_t, not
// the full precision.
void SetToFilePathRange(const base::FilePath& path,
uint64 offset, uint64 length,
const base::Time& expected_modification_time) {
type_ = TYPE_FILE;
file_path_ = path;
file_range_offset_ = offset;
file_range_length_ = length;
expected_file_modification_time_ = expected_modification_time;
}
private:
Type type_;
std::vector<char> buf_;
const char* bytes_start_;
uint64 bytes_length_;
base::FilePath file_path_;
uint64 file_range_offset_;
uint64 file_range_length_;
base::Time expected_file_modification_time_;
DISALLOW_COPY_AND_ASSIGN(UploadElement);
};
#if defined(UNIT_TEST)
inline bool operator==(const UploadElement& a,
const UploadElement& b) {
if (a.type() != b.type())
return false;
if (a.type() == UploadElement::TYPE_BYTES)
return a.bytes_length() == b.bytes_length() &&
memcmp(a.bytes(), b.bytes(), b.bytes_length()) == 0;
if (a.type() == UploadElement::TYPE_FILE) {
return a.file_path() == b.file_path() &&
a.file_range_offset() == b.file_range_offset() &&
a.file_range_length() == b.file_range_length() &&
a.expected_file_modification_time() ==
b.expected_file_modification_time();
}
return false;
}
inline bool operator!=(const UploadElement& a,
const UploadElement& b) {
return !(a == b);
}
#endif // defined(UNIT_TEST)
} // namespace net
#endif // CEF_LIBCEF_COMMON_UPLOAD_ELEMENT_H_

View File

@ -384,7 +384,7 @@ bool CefDictionaryValueImpl::SetBool(const CefString& key, bool value) {
CEF_VALUE_VERIFY_RETURN(true, false);
RemoveInternal(key);
mutable_value()->SetWithoutPathExpansion(key,
base::Value::CreateBooleanValue(value));
new base::FundamentalValue(value));
return true;
}
@ -392,7 +392,7 @@ bool CefDictionaryValueImpl::SetInt(const CefString& key, int value) {
CEF_VALUE_VERIFY_RETURN(true, false);
RemoveInternal(key);
mutable_value()->SetWithoutPathExpansion(key,
base::Value::CreateIntegerValue(value));
new base::FundamentalValue(value));
return true;
}
@ -400,7 +400,7 @@ bool CefDictionaryValueImpl::SetDouble(const CefString& key, double value) {
CEF_VALUE_VERIFY_RETURN(true, false);
RemoveInternal(key);
mutable_value()->SetWithoutPathExpansion(key,
base::Value::CreateDoubleValue(value));
new base::FundamentalValue(value));
return true;
}
@ -409,7 +409,7 @@ bool CefDictionaryValueImpl::SetString(const CefString& key,
CEF_VALUE_VERIFY_RETURN(true, false);
RemoveInternal(key);
mutable_value()->SetWithoutPathExpansion(key,
base::Value::CreateStringValue(value.ToString()));
new base::StringValue(value.ToString()));
return true;
}
@ -729,7 +729,7 @@ bool CefListValueImpl::SetNull(int index) {
bool CefListValueImpl::SetBool(int index, bool value) {
CEF_VALUE_VERIFY_RETURN(true, false);
base::Value* new_value = base::Value::CreateBooleanValue(value);
base::Value* new_value = new base::FundamentalValue(value);
if (RemoveInternal(index))
mutable_value()->Insert(index, new_value);
else
@ -739,7 +739,7 @@ bool CefListValueImpl::SetBool(int index, bool value) {
bool CefListValueImpl::SetInt(int index, int value) {
CEF_VALUE_VERIFY_RETURN(true, false);
base::Value* new_value = base::Value::CreateIntegerValue(value);
base::Value* new_value = new base::FundamentalValue(value);
if (RemoveInternal(index))
mutable_value()->Insert(index, new_value);
else
@ -749,7 +749,7 @@ bool CefListValueImpl::SetInt(int index, int value) {
bool CefListValueImpl::SetDouble(int index, double value) {
CEF_VALUE_VERIFY_RETURN(true, false);
base::Value* new_value = base::Value::CreateDoubleValue(value);
base::Value* new_value = new base::FundamentalValue(value);
if (RemoveInternal(index))
mutable_value()->Insert(index, new_value);
else
@ -759,7 +759,7 @@ bool CefListValueImpl::SetDouble(int index, double value) {
bool CefListValueImpl::SetString(int index, const CefString& value) {
CEF_VALUE_VERIFY_RETURN(true, false);
base::Value* new_value = base::Value::CreateStringValue(value.ToString());
base::Value* new_value = new base::StringValue(value.ToString());
if (RemoveInternal(index))
mutable_value()->Insert(index, new_value);
else

View File

@ -7,8 +7,8 @@
#include "config.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8RecursionScope.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8RecursionScope.h"
MSVC_POP_WARNING();
#undef ceil
#undef FROM_HERE
@ -37,8 +37,9 @@ MSVC_POP_WARNING();
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/renderer/loadtimes_extension_bindings.h"
#include "chrome/renderer/pepper/ppb_pdf_impl.h"
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
#include "chrome/renderer/printing/print_web_view_helper.h"
#include "components/pdf/renderer/ppb_pdf_impl.h"
#include "content/child/child_thread.h"
#include "content/child/worker_task_runner.h"
#include "content/common/frame_messages.h"
@ -65,7 +66,6 @@ MSVC_POP_WARNING();
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/WebKit/public/web/WebWorkerInfo.h"
#include "v8/include/v8.h"
#if defined(OS_WIN)
@ -468,6 +468,9 @@ void CefContentRendererClient::RenderThreadStarted() {
// Cross-origin entries need to be added after WebKit is initialized.
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
pdf_print_client_.reset(new ChromePDFPrintClient());
pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get());
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();
if (application.get()) {
@ -650,9 +653,9 @@ void CefContentRendererClient::DidCreateScriptContext(
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope(
blink::V8RecursionScope recursion_scope(
isolate,
WebCore::toExecutionContext(context));
blink::toExecutionContext(context));
CefRefPtr<CefV8Context> contextPtr(new CefV8ContextImpl(isolate, context));
@ -671,7 +674,7 @@ const void* CefContentRendererClient::CreatePPAPIInterface(
#if defined(ENABLE_PLUGINS)
// Used for in-process PDF plugin.
if (interface_name == PPB_PDF_INTERFACE)
return PPB_PDF_Impl::GetInterface();
return pdf::PPB_PDF_Impl::GetInterface();
#endif
return NULL;
}
@ -693,9 +696,9 @@ void CefContentRendererClient::WillReleaseScriptContext(
v8::Isolate* isolate = blink::mainThreadIsolate();
v8::HandleScope handle_scope(isolate);
v8::Context::Scope scope(context);
WebCore::V8RecursionScope recursion_scope(
blink::V8RecursionScope recursion_scope(
isolate,
WebCore::toExecutionContext(context));
blink::toExecutionContext(context));
CefRefPtr<CefV8Context> contextPtr(
new CefV8ContextImpl(isolate, context));
@ -746,7 +749,7 @@ void CefContentRendererClient::BrowserCreated(
browsers_.insert(std::make_pair(render_view, browser));
new CefPrerendererClient(render_view);
new printing::PrintWebViewHelper(render_view);
new printing::PrintWebViewHelper(render_view, false, false);
// Notify the render process handler.
CefRefPtr<CefApp> application = CefContentClient::Get()->application();

View File

@ -22,6 +22,7 @@
class CefRenderProcessObserver;
struct Cef_CrossOriginWhiteListEntry_Params;
class ChromePDFPrintClient;
class CefContentRendererClient : public content::ContentRendererClient,
public base::MessageLoop::DestructionObserver {
@ -121,6 +122,8 @@ class CefContentRendererClient : public content::ContentRendererClient,
typedef std::vector<Cef_CrossOriginWhiteListEntry_Params> CrossOriginList;
CrossOriginList cross_origin_whitelist_entries_;
scoped_ptr<ChromePDFPrintClient> pdf_print_client_;
int devtools_agent_count_;
int uncaught_exception_stack_size_;

View File

@ -1,154 +0,0 @@
// Copyright (c) 2012 The Chromium Embedded Framework 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/renderer/dom_event_impl.h"
#include "libcef/renderer/dom_document_impl.h"
#include "libcef/renderer/thread_util.h"
#include "base/logging.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDOMEvent.h"
using blink::WebDOMEvent;
using blink::WebString;
CefDOMEventImpl::CefDOMEventImpl(CefRefPtr<CefDOMDocumentImpl> document,
const blink::WebDOMEvent& event)
: document_(document),
event_(event) {
DCHECK(!event_.isNull());
}
CefDOMEventImpl::~CefDOMEventImpl() {
CEF_REQUIRE_RT();
DCHECK(event_.isNull());
}
CefString CefDOMEventImpl::GetType() {
CefString str;
if (!VerifyContext())
return str;
const WebString& type = event_.type();
if (!type.isNull())
str = type;
return str;
}
CefDOMEventImpl::Category CefDOMEventImpl::GetCategory() {
if (!VerifyContext())
return DOM_EVENT_CATEGORY_UNKNOWN;
int flags = 0;
if (event_.isUIEvent())
flags |= DOM_EVENT_CATEGORY_UI;
if (event_.isMouseEvent())
flags |= DOM_EVENT_CATEGORY_MOUSE;
if (event_.isMutationEvent())
flags |= DOM_EVENT_CATEGORY_MUTATION;
if (event_.isKeyboardEvent())
flags |= DOM_EVENT_CATEGORY_KEYBOARD;
if (event_.isTextEvent())
flags |= DOM_EVENT_CATEGORY_TEXT;
if (event_.isCompositionEvent())
flags |= DOM_EVENT_CATEGORY_COMPOSITION;
if (event_.isDragEvent())
flags |= DOM_EVENT_CATEGORY_DRAG;
if (event_.isClipboardEvent())
flags |= DOM_EVENT_CATEGORY_CLIPBOARD;
if (event_.isMessageEvent())
flags |= DOM_EVENT_CATEGORY_MESSAGE;
if (event_.isWheelEvent())
flags |= DOM_EVENT_CATEGORY_WHEEL;
if (event_.isBeforeTextInsertedEvent())
flags |= DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED;
if (event_.isOverflowEvent())
flags |= DOM_EVENT_CATEGORY_OVERFLOW;
if (event_.isPageTransitionEvent())
flags |= DOM_EVENT_CATEGORY_PAGE_TRANSITION;
if (event_.isPopStateEvent())
flags |= DOM_EVENT_CATEGORY_POPSTATE;
if (event_.isProgressEvent())
flags |= DOM_EVENT_CATEGORY_PROGRESS;
if (event_.isXMLHttpRequestProgressEvent())
flags |= DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS;
return static_cast<Category>(flags);
}
CefDOMEventImpl::Phase CefDOMEventImpl::GetPhase() {
if (!VerifyContext())
return DOM_EVENT_PHASE_UNKNOWN;
switch (event_.eventPhase()) {
case WebDOMEvent::CapturingPhase:
return DOM_EVENT_PHASE_CAPTURING;
case WebDOMEvent::AtTarget:
return DOM_EVENT_PHASE_AT_TARGET;
case WebDOMEvent::BubblingPhase:
return DOM_EVENT_PHASE_BUBBLING;
}
return DOM_EVENT_PHASE_UNKNOWN;
}
bool CefDOMEventImpl::CanBubble() {
if (!VerifyContext())
return false;
return event_.bubbles();
}
bool CefDOMEventImpl::CanCancel() {
if (!VerifyContext())
return false;
return event_.cancelable();
}
CefRefPtr<CefDOMDocument> CefDOMEventImpl::GetDocument() {
if (!VerifyContext())
return NULL;
return document_.get();
}
CefRefPtr<CefDOMNode> CefDOMEventImpl::GetTarget() {
if (!VerifyContext())
return NULL;
return document_->GetOrCreateNode(event_.target());
}
CefRefPtr<CefDOMNode> CefDOMEventImpl::GetCurrentTarget() {
if (!VerifyContext())
return NULL;
return document_->GetOrCreateNode(event_.currentTarget());
}
void CefDOMEventImpl::Detach() {
// If you hit this assert it means that you are keeping references to this
// event object beyond the valid scope.
DCHECK(HasOneRef());
document_ = NULL;
event_.assign(WebDOMEvent());
}
bool CefDOMEventImpl::VerifyContext() {
if (!document_.get()) {
NOTREACHED();
return false;
}
if (!document_->VerifyContext())
return false;
if (event_.isNull()) {
NOTREACHED();
return false;
}
return true;
}

View File

@ -1,43 +0,0 @@
// Copyright (c) 2012 The Chromium Embedded Framework 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_DOM_EVENT_IMPL_H_
#define CEF_LIBCEF_DOM_EVENT_IMPL_H_
#pragma once
#include "include/cef_dom.h"
#include "third_party/WebKit/public/web/WebDOMEvent.h"
class CefDOMDocumentImpl;
class CefDOMEventImpl : public CefDOMEvent {
public:
CefDOMEventImpl(CefRefPtr<CefDOMDocumentImpl> document,
const blink::WebDOMEvent& event);
virtual ~CefDOMEventImpl();
// CefDOMEvent methods.
virtual CefString GetType() OVERRIDE;
virtual Category GetCategory() OVERRIDE;
virtual Phase GetPhase() OVERRIDE;
virtual bool CanBubble() OVERRIDE;
virtual bool CanCancel() OVERRIDE;
virtual CefRefPtr<CefDOMDocument> GetDocument() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetTarget() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetCurrentTarget() OVERRIDE;
// Will be called from CefDOMEventListenerWrapper::handleEvent().
void Detach();
// Verify that the object exists and is being accessed on the UI thread.
bool VerifyContext();
protected:
CefRefPtr<CefDOMDocumentImpl> document_;
blink::WebDOMEvent event_;
IMPLEMENT_REFCOUNTING(CefDOMEventImpl);
};
#endif // CEF_LIBCEF_DOM_EVENT_IMPL_H_

View File

@ -6,7 +6,6 @@
#include "libcef/common/tracker.h"
#include "libcef/renderer/browser_impl.h"
#include "libcef/renderer/dom_document_impl.h"
#include "libcef/renderer/dom_event_impl.h"
#include "libcef/renderer/thread_util.h"
#include "libcef/renderer/webkit_glue.h"
@ -16,7 +15,6 @@
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebDOMEvent.h"
#include "third_party/WebKit/public/web/WebDOMEventListener.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebFormControlElement.h"
@ -26,7 +24,6 @@
using blink::WebDocument;
using blink::WebDOMEvent;
using blink::WebDOMEventListener;
using blink::WebElement;
using blink::WebFrame;
using blink::WebFormControlElement;
@ -35,55 +32,6 @@ using blink::WebNode;
using blink::WebSelectElement;
using blink::WebString;
namespace {
// Wrapper implementation for WebDOMEventListener.
class CefDOMEventListenerWrapper : public WebDOMEventListener,
public CefTrackNode {
public:
CefDOMEventListenerWrapper(CefBrowserImpl* browser, WebFrame* frame,
CefRefPtr<CefDOMEventListener> listener)
: browser_(browser),
frame_(frame),
listener_(listener) {
// Cause this object to be deleted immediately before the frame is closed.
browser->AddFrameObject(webkit_glue::GetIdentifier(frame), this);
}
virtual ~CefDOMEventListenerWrapper() {
CEF_REQUIRE_RT();
}
virtual void handleEvent(const WebDOMEvent& event) {
CefRefPtr<CefDOMDocumentImpl> documentImpl;
CefRefPtr<CefDOMEventImpl> eventImpl;
if (!event.isNull()) {
// Create CefDOMDocumentImpl and CefDOMEventImpl objects that are valid
// only for the scope of this method.
const WebDocument& document = frame_->document();
if (!document.isNull()) {
documentImpl = new CefDOMDocumentImpl(browser_, frame_);
eventImpl = new CefDOMEventImpl(documentImpl, event);
}
}
listener_->HandleEvent(eventImpl.get());
if (eventImpl.get())
eventImpl->Detach();
if (documentImpl.get())
documentImpl->Detach();
}
protected:
CefBrowserImpl* browser_;
WebFrame* frame_;
CefRefPtr<CefDOMEventListener> listener_;
};
} // namespace
CefDOMNodeImpl::CefDOMNodeImpl(CefRefPtr<CefDOMDocumentImpl> document,
const blink::WebNode& node)
: document_(document),
@ -331,18 +279,6 @@ CefRefPtr<CefDOMNode> CefDOMNodeImpl::GetLastChild() {
return document_->GetOrCreateNode(node_.lastChild());
}
void CefDOMNodeImpl::AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener,
bool useCapture) {
if (!VerifyContext())
return;
node_.addEventListener(base::string16(eventType),
new CefDOMEventListenerWrapper(document_->GetBrowser(),
document_->GetFrame(), listener),
useCapture);
}
CefString CefDOMNodeImpl::GetElementTagName() {
CefString str;
if (!VerifyContext())

View File

@ -36,9 +36,6 @@ class CefDOMNodeImpl : public CefDOMNode {
virtual bool HasChildren() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetFirstChild() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetLastChild() OVERRIDE;
virtual void AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener,
bool useCapture) OVERRIDE;
virtual CefString GetElementTagName() OVERRIDE;
virtual bool HasElementAttributes() OVERRIDE;
virtual bool HasElementAttribute(const CefString& attrName) OVERRIDE;

View File

@ -17,8 +17,8 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "core/frame/Frame.h"
#include "core/frame/LocalFrame.h"
#include "core/workers/WorkerGlobalScope.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8Binding.h"
MSVC_POP_WARNING();
#undef FROM_HERE
#undef LOG
@ -551,15 +551,15 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
// Execute the function call using the ScriptController so that inspector
// instrumentation works.
if (CEF_CURRENTLY_ON_RT()) {
RefPtr<WebCore::LocalFrame> frame = WebCore::toFrameIfNotDetached(context);
RefPtr<blink::LocalFrame> frame = blink::toFrameIfNotDetached(context);
DCHECK(frame);
if (frame &&
frame->script().canExecuteScripts(WebCore::AboutToExecuteScript)) {
frame->script().canExecuteScripts(blink::AboutToExecuteScript)) {
func_rv = frame->script().callFunction(function, receiver, argc, args);
}
} else {
func_rv = WebCore::ScriptController::callFunction(
WebCore::toExecutionContext(context),
func_rv = blink::ScriptController::callFunction(
blink::toExecutionContext(context),
function, receiver, argc, args, isolate);
}
@ -888,7 +888,7 @@ bool CefV8ContextImpl::Enter() {
v8::Isolate* isolate = handle_->isolate();
v8::HandleScope handle_scope(isolate);
WebCore::V8PerIsolateData::from(isolate)->incrementRecursionLevel();
blink::V8PerIsolateData::from(isolate)->incrementRecursionLevel();
handle_->GetNewV8Handle()->Enter();
#ifndef NDEBUG
++enter_count_;
@ -904,7 +904,7 @@ bool CefV8ContextImpl::Exit() {
DLOG_ASSERT(enter_count_ > 0);
handle_->GetNewV8Handle()->Exit();
WebCore::V8PerIsolateData::from(isolate)->decrementRecursionLevel();
blink::V8PerIsolateData::from(isolate)->decrementRecursionLevel();
#ifndef NDEBUG
--enter_count_;
#endif
@ -1712,8 +1712,17 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
bool set = obj->Set(GetV8String(isolate, key), impl->GetV8Value(true),
static_cast<v8::PropertyAttribute>(attribute));
bool set;
// TODO(cef): This usage may not exactly match the previous implementation.
// Set will trigger interceptors and/or accessors whereas ForceSet will not.
// It might be better to split this functionality into separate methods.
if (attribute == V8_PROPERTY_ATTRIBUTE_NONE) {
set = obj->Set(GetV8String(isolate, key), impl->GetV8Value(true));
} else {
set = obj->ForceSet(GetV8String(isolate, key),
impl->GetV8Value(true),
static_cast<v8::PropertyAttribute>(attribute));
}
return (!HasCaught(try_catch) && set);
} else {
NOTREACHED() << "invalid input parameter";

View File

@ -78,7 +78,7 @@ std::string DumpDocumentText(blink::WebFrame* frame) {
}
bool SetNodeValue(blink::WebNode& node, const blink::WebString& value) {
WebCore::Node* web_node = node.unwrap<WebCore::Node>();
blink::Node* web_node = node.unwrap<blink::Node>();
web_node->setNodeValue(value);
return true;
}

View File

@ -1,159 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
#include "libcef_dll/cpptoc/domevent_cpptoc.h"
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
cef_string_userfree_t CEF_CALLBACK domevent_get_type(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefDOMEventCppToC::Get(self)->GetType();
// Return type: string
return _retval.DetachToUserFree();
}
cef_dom_event_category_t CEF_CALLBACK domevent_get_category(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return DOM_EVENT_CATEGORY_UNKNOWN;
// Execute
cef_dom_event_category_t _retval = CefDOMEventCppToC::Get(self)->GetCategory(
);
// Return type: simple
return _retval;
}
cef_dom_event_phase_t CEF_CALLBACK domevent_get_phase(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return DOM_EVENT_PHASE_UNKNOWN;
// Execute
cef_dom_event_phase_t _retval = CefDOMEventCppToC::Get(self)->GetPhase();
// Return type: simple
return _retval;
}
int CEF_CALLBACK domevent_can_bubble(struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefDOMEventCppToC::Get(self)->CanBubble();
// Return type: bool
return _retval;
}
int CEF_CALLBACK domevent_can_cancel(struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefDOMEventCppToC::Get(self)->CanCancel();
// Return type: bool
return _retval;
}
cef_domdocument_t* CEF_CALLBACK domevent_get_document(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMDocument> _retval = CefDOMEventCppToC::Get(self)->GetDocument(
);
// Return type: refptr_same
return CefDOMDocumentCppToC::Wrap(_retval);
}
cef_domnode_t* CEF_CALLBACK domevent_get_target(struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMEventCppToC::Get(self)->GetTarget();
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
cef_domnode_t* CEF_CALLBACK domevent_get_current_target(
struct _cef_domevent_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMEventCppToC::Get(
self)->GetCurrentTarget();
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
// CONSTRUCTOR - Do not edit by hand.
CefDOMEventCppToC::CefDOMEventCppToC(CefDOMEvent* cls)
: CefCppToC<CefDOMEventCppToC, CefDOMEvent, cef_domevent_t>(cls) {
struct_.struct_.get_type = domevent_get_type;
struct_.struct_.get_category = domevent_get_category;
struct_.struct_.get_phase = domevent_get_phase;
struct_.struct_.can_bubble = domevent_can_bubble;
struct_.struct_.can_cancel = domevent_can_cancel;
struct_.struct_.get_document = domevent_get_document;
struct_.struct_.get_target = domevent_get_target;
struct_.struct_.get_current_target = domevent_get_current_target;
}
#ifndef NDEBUG
template<> base::AtomicRefCount CefCppToC<CefDOMEventCppToC, CefDOMEvent,
cef_domevent_t>::DebugObjCt = 0;
#endif

View File

@ -1,36 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_
#pragma once
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/cpptoc/cpptoc.h"
// Wrap a C++ class with a C structure.
// This class may be instantiated and accessed DLL-side only.
class CefDOMEventCppToC
: public CefCppToC<CefDOMEventCppToC, CefDOMEvent, cef_domevent_t> {
public:
explicit CefDOMEventCppToC(CefDOMEvent* cls);
virtual ~CefDOMEventCppToC() {}
};
#endif // BUILDING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_CPPTOC_H_

View File

@ -1,49 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
#include "libcef_dll/ctocpp/domevent_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK domevent_listener_handle_event(
struct _cef_domevent_listener_t* self, cef_domevent_t* event) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: event; type: refptr_diff
DCHECK(event);
if (!event)
return;
// Execute
CefDOMEventListenerCppToC::Get(self)->HandleEvent(
CefDOMEventCToCpp::Wrap(event));
}
// CONSTRUCTOR - Do not edit by hand.
CefDOMEventListenerCppToC::CefDOMEventListenerCppToC(CefDOMEventListener* cls)
: CefCppToC<CefDOMEventListenerCppToC, CefDOMEventListener,
cef_domevent_listener_t>(cls) {
struct_.struct_.handle_event = domevent_listener_handle_event;
}
#ifndef NDEBUG
template<> base::AtomicRefCount CefCppToC<CefDOMEventListenerCppToC,
CefDOMEventListener, cef_domevent_listener_t>::DebugObjCt = 0;
#endif

View File

@ -1,37 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/cpptoc/cpptoc.h"
// Wrap a C++ class with a C structure.
// This class may be instantiated and accessed wrapper-side only.
class CefDOMEventListenerCppToC
: public CefCppToC<CefDOMEventListenerCppToC, CefDOMEventListener,
cef_domevent_listener_t> {
public:
explicit CefDOMEventListenerCppToC(CefDOMEventListener* cls);
virtual ~CefDOMEventListenerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CPPTOC_DOMEVENT_LISTENER_CPPTOC_H_

View File

@ -12,7 +12,6 @@
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
#include "libcef_dll/ctocpp/domevent_listener_ctocpp.h"
#include "libcef_dll/transfer_util.h"
@ -294,30 +293,6 @@ struct _cef_domnode_t* CEF_CALLBACK domnode_get_last_child(
return CefDOMNodeCppToC::Wrap(_retval);
}
void CEF_CALLBACK domnode_add_event_listener(struct _cef_domnode_t* self,
const cef_string_t* eventType, struct _cef_domevent_listener_t* listener,
int useCapture) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: eventType; type: string_byref_const
DCHECK(eventType);
if (!eventType)
return;
// Verify param: listener; type: refptr_diff
DCHECK(listener);
if (!listener)
return;
// Execute
CefDOMNodeCppToC::Get(self)->AddEventListener(
CefString(eventType),
CefDOMEventListenerCToCpp::Wrap(listener),
useCapture?true:false);
}
cef_string_userfree_t CEF_CALLBACK domnode_get_element_tag_name(
struct _cef_domnode_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -476,7 +451,6 @@ CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls)
struct_.struct_.has_children = domnode_has_children;
struct_.struct_.get_first_child = domnode_get_first_child;
struct_.struct_.get_last_child = domnode_get_last_child;
struct_.struct_.add_event_listener = domnode_add_event_listener;
struct_.struct_.get_element_tag_name = domnode_get_element_tag_name;
struct_.struct_.has_element_attributes = domnode_has_element_attributes;
struct_.struct_.has_element_attribute = domnode_has_element_attribute;

View File

@ -315,23 +315,6 @@ void CEF_CALLBACK render_handler_update_drag_cursor(
operation);
}
void CEF_CALLBACK render_handler_on_scroll_offset_changed(
struct _cef_render_handler_t* self, cef_browser_t* browser) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Execute
CefRenderHandlerCppToC::Get(self)->OnScrollOffsetChanged(
CefBrowserCToCpp::Wrap(browser));
}
// CONSTRUCTOR - Do not edit by hand.
@ -348,8 +331,6 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls)
struct_.struct_.on_cursor_change = render_handler_on_cursor_change;
struct_.struct_.start_dragging = render_handler_start_dragging;
struct_.struct_.update_drag_cursor = render_handler_update_drag_cursor;
struct_.struct_.on_scroll_offset_changed =
render_handler_on_scroll_offset_changed;
}
#ifndef NDEBUG

View File

@ -1,131 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domevent_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefString CefDOMEventCToCpp::GetType() {
if (CEF_MEMBER_MISSING(struct_, get_type))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_type(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() {
if (CEF_MEMBER_MISSING(struct_, get_category))
return DOM_EVENT_CATEGORY_UNKNOWN;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_event_category_t _retval = struct_->get_category(struct_);
// Return type: simple
return _retval;
}
CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() {
if (CEF_MEMBER_MISSING(struct_, get_phase))
return DOM_EVENT_PHASE_UNKNOWN;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_event_phase_t _retval = struct_->get_phase(struct_);
// Return type: simple
return _retval;
}
bool CefDOMEventCToCpp::CanBubble() {
if (CEF_MEMBER_MISSING(struct_, can_bubble))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->can_bubble(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefDOMEventCToCpp::CanCancel() {
if (CEF_MEMBER_MISSING(struct_, can_cancel))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->can_cancel(struct_);
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefDOMDocument> CefDOMEventCToCpp::GetDocument() {
if (CEF_MEMBER_MISSING(struct_, get_document))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domdocument_t* _retval = struct_->get_document(struct_);
// Return type: refptr_same
return CefDOMDocumentCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMEventCToCpp::GetTarget() {
if (CEF_MEMBER_MISSING(struct_, get_target))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_target(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMEventCToCpp::GetCurrentTarget() {
if (CEF_MEMBER_MISSING(struct_, get_current_target))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_current_target(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
#ifndef NDEBUG
template<> base::AtomicRefCount CefCToCpp<CefDOMEventCToCpp, CefDOMEvent,
cef_domevent_t>::DebugObjCt = 0;
#endif

View File

@ -1,47 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefDOMEventCToCpp
: public CefCToCpp<CefDOMEventCToCpp, CefDOMEvent, cef_domevent_t> {
public:
explicit CefDOMEventCToCpp(cef_domevent_t* str)
: CefCToCpp<CefDOMEventCToCpp, CefDOMEvent, cef_domevent_t>(str) {}
virtual ~CefDOMEventCToCpp() {}
// CefDOMEvent methods
virtual CefString GetType() OVERRIDE;
virtual Category GetCategory() OVERRIDE;
virtual Phase GetPhase() OVERRIDE;
virtual bool CanBubble() OVERRIDE;
virtual bool CanCancel() OVERRIDE;
virtual CefRefPtr<CefDOMDocument> GetDocument() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetTarget() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetCurrentTarget() OVERRIDE;
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_

View File

@ -1,40 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domevent_cpptoc.h"
#include "libcef_dll/ctocpp/domevent_listener_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr<CefDOMEvent> event) {
if (CEF_MEMBER_MISSING(struct_, handle_event))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: event; type: refptr_diff
DCHECK(event.get());
if (!event.get())
return;
// Execute
struct_->handle_event(struct_,
CefDOMEventCppToC::Wrap(event));
}
#ifndef NDEBUG
template<> base::AtomicRefCount CefCToCpp<CefDOMEventListenerCToCpp,
CefDOMEventListener, cef_domevent_listener_t>::DebugObjCt = 0;
#endif

View File

@ -1,42 +0,0 @@
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_
#pragma once
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefDOMEventListenerCToCpp
: public CefCToCpp<CefDOMEventListenerCToCpp, CefDOMEventListener,
cef_domevent_listener_t> {
public:
explicit CefDOMEventListenerCToCpp(cef_domevent_listener_t* str)
: CefCToCpp<CefDOMEventListenerCToCpp, CefDOMEventListener,
cef_domevent_listener_t>(str) {}
virtual ~CefDOMEventListenerCToCpp() {}
// CefDOMEventListener methods
virtual void HandleEvent(CefRefPtr<CefDOMEvent> event) OVERRIDE;
};
#endif // BUILDING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_

View File

@ -10,7 +10,6 @@
// for more information.
//
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
#include "libcef_dll/transfer_util.h"
@ -273,29 +272,6 @@ CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetLastChild() {
return CefDOMNodeCToCpp::Wrap(_retval);
}
void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener, bool useCapture) {
if (CEF_MEMBER_MISSING(struct_, add_event_listener))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: eventType; type: string_byref_const
DCHECK(!eventType.empty());
if (eventType.empty())
return;
// Verify param: listener; type: refptr_diff
DCHECK(listener.get());
if (!listener.get())
return;
// Execute
struct_->add_event_listener(struct_,
eventType.GetStruct(),
CefDOMEventListenerCppToC::Wrap(listener),
useCapture);
}
CefString CefDOMNodeCToCpp::GetElementTagName() {
if (CEF_MEMBER_MISSING(struct_, get_element_tag_name))
return CefString();

View File

@ -50,8 +50,6 @@ class CefDOMNodeCToCpp
virtual bool HasChildren() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetFirstChild() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetLastChild() OVERRIDE;
virtual void AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener, bool useCapture) OVERRIDE;
virtual CefString GetElementTagName() OVERRIDE;
virtual bool HasElementAttributes() OVERRIDE;
virtual bool HasElementAttribute(const CefString& attrName) OVERRIDE;

View File

@ -250,23 +250,6 @@ void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr<CefBrowser> browser,
operation);
}
void CefRenderHandlerCToCpp::OnScrollOffsetChanged(
CefRefPtr<CefBrowser> browser) {
if (CEF_MEMBER_MISSING(struct_, on_scroll_offset_changed))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get())
return;
// Execute
struct_->on_scroll_offset_changed(struct_,
CefBrowserCppToC::Wrap(browser));
}
#ifndef NDEBUG
template<> base::AtomicRefCount CefCToCpp<CefRenderHandlerCToCpp,

View File

@ -55,7 +55,6 @@ class CefRenderHandlerCToCpp
int y) OVERRIDE;
virtual void UpdateDragCursor(CefRefPtr<CefBrowser> browser,
DragOperation operation) OVERRIDE;
virtual void OnScrollOffsetChanged(CefRefPtr<CefBrowser> browser) OVERRIDE;
};
#endif // BUILDING_CEF_SHARED

View File

@ -42,7 +42,6 @@
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
#include "libcef_dll/cpptoc/context_menu_params_cpptoc.h"
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
#include "libcef_dll/cpptoc/domevent_cpptoc.h"
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
#include "libcef_dll/cpptoc/download_item_cpptoc.h"
@ -77,7 +76,6 @@
#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"
#include "libcef_dll/ctocpp/domvisitor_ctocpp.h"
#include "libcef_dll/ctocpp/dialog_handler_ctocpp.h"
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
@ -197,8 +195,6 @@ CEF_EXPORT void cef_shutdown() {
DCHECK(base::AtomicRefCountIsZero(&CefContextMenuParamsCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefCookieVisitorCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMDocumentCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMEventCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMEventListenerCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMNodeCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMVisitorCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDialogHandlerCToCpp::DebugObjCt));

View File

@ -111,7 +111,7 @@ class CefBrowserInfoMap {
if (browser_info_map_.empty())
return;
bool remove, keepgoing;
bool remove, keepgoing = true;
typename BrowserInfoMap::iterator it_browser = browser_info_map_.begin();
while (it_browser != browser_info_map_.end()) {

View File

@ -38,7 +38,6 @@
#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"
#include "libcef_dll/cpptoc/domvisitor_cpptoc.h"
#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h"
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
@ -79,7 +78,6 @@
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h"
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domevent_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
#include "libcef_dll/ctocpp/download_item_ctocpp.h"
@ -189,8 +187,6 @@ CEF_GLOBAL void CefShutdown() {
DCHECK(base::AtomicRefCountIsZero(&CefContextMenuParamsCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefCookieVisitorCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMDocumentCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMEventCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMEventListenerCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMNodeCToCpp::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDOMVisitorCppToC::DebugObjCt));
DCHECK(base::AtomicRefCountIsZero(&CefDialogHandlerCppToC::DebugObjCt));

View File

@ -35,12 +35,6 @@ patches = [
'name': 'message_loop_443',
'path': '../base/message_loop/',
},
{
# Disable event type assertion in WebNode::addEventListener.
# http://code.google.com/p/chromiumembedded/issues/detail?id=933
'name': 'webkit_933',
'path': '../third_party/WebKit/Source/web/',
},
{
# Fix ninja output for localization directories on OS X.
# http://code.google.com/p/gyp/issues/detail?id=331
@ -98,13 +92,6 @@ patches = [
'name': 'prefs_content_1161',
'path': '../content/',
},
{
# Allow customization of the WebView background color.
# http://code.google.com/p/chromiumembedded/issues/detail?id=1161
# https://codereview.chromium.org/228603007/
'name': 'prefs_webkit_1161',
'path': '../webkit/',
},
{
# Revert Blink revision 177068 changes due to _web_drawFocusRingWithFrame
# unrecognized selector error during offscreen rendering of popups.
@ -118,6 +105,13 @@ patches = [
'name': 'ui_dragdrop_355390',
'path': '../ui/base/dragdrop/',
},
{
# Fix printing on Windows. Reverts portions of the below changes.
# https://codereview.chromium.org/480303002
# https://codereview.chromium.org/488853002
'name': 'printing_win',
'path': '../',
},
{
# Disable scollbar bounce and overlay on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=364

View File

@ -1,25 +1,18 @@
Index: web_contents_impl.cc
===================================================================
--- web_contents_impl.cc (revision 280796)
+++ web_contents_impl.cc (working copy)
@@ -1073,22 +1073,29 @@
diff --git web_contents_impl.cc web_contents_impl.cc
index f1a9d02..243bbc8 100644
--- web_contents_impl.cc
+++ web_contents_impl.cc
@@ -1147,22 +1147,29 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
params.browser_context, params.site_instance, params.routing_id,
params.main_frame_routing_id);
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
-
- if (browser_plugin_guest_) {
- scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
+ if (!view_) {
+ WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
-
- WebContentsViewGuest* rv = new WebContentsViewGuest(
- this, browser_plugin_guest_.get(), platform_view.Pass(),
- render_view_host_delegate_view_);
@ -29,6 +22,15 @@ Index: web_contents_impl.cc
- // Regular WebContentsView.
- view_.reset(CreateWebContentsView(
- this, delegate, &render_view_host_delegate_view_));
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
+
+ if (!view_) {
+ WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+
+ if (browser_plugin_guest_) {
+ scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
+ this, delegate, &render_view_host_delegate_view_));
@ -46,7 +48,7 @@ Index: web_contents_impl.cc
}
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
@@ -1407,6 +1414,9 @@
@@ -1479,6 +1486,9 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -56,7 +58,7 @@ Index: web_contents_impl.cc
if (delegate_ &&
!delegate_->ShouldCreateWebContents(this,
route_id,
@@ -1414,7 +1424,9 @@
@@ -1486,7 +1496,9 @@ void WebContentsImpl::CreateNewWindow(
params.frame_name,
params.target_url,
partition_id,
@ -67,7 +69,7 @@ Index: web_contents_impl.cc
if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to
@@ -1434,6 +1446,8 @@
@@ -1506,6 +1518,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.main_frame_routing_id = main_frame_route_id;
create_params.opener = this;
create_params.opener_suppressed = params.opener_suppressed;

View File

@ -1,37 +1,7 @@
Index: mac/strip_save_dsym
===================================================================
--- mac/strip_save_dsym (revision 280796)
+++ mac/strip_save_dsym (working copy)
@@ -48,7 +48,7 @@
"bundle"]
macho_types_re = "Mach-O (?:64-bit )?(?:" + "|".join(macho_types) + ")"
- file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "--", macho],
+ file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "-L", "--", macho],
stdout=subprocess.PIPE)
archs = []
Index: gyp_chromium
===================================================================
--- gyp_chromium (revision 280796)
+++ gyp_chromium (working copy)
@@ -257,12 +257,6 @@
if sys.platform not in ('darwin',):
args.append('--no-circular-check')
- # We explicitly don't support the make gyp generator (crbug.com/348686). Be
- # nice and fail here, rather than choking in gyp.
- if re.search(r'(^|,|\s)make($|,|\s)', os.environ.get('GYP_GENERATORS', '')):
- print 'Error: make gyp generator not supported (check GYP_GENERATORS).'
- sys.exit(1)
-
# Default to ninja on linux and windows, but only if no generator has
# explicitly been set.
# Also default to ninja on mac, but only when not building chrome/ios.
Index: common.gypi
===================================================================
--- common.gypi (revision 280796)
+++ common.gypi (working copy)
diff --git common.gypi common.gypi
index ea388ac..d0864e3 100644
--- common.gypi
+++ common.gypi
@@ -9,6 +9,9 @@
# Variables expected to be overriden on the GYP command line (-D) or by
# ~/.gyp/include.gypi.
@ -42,13 +12,43 @@ 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
@@ -5175,6 +5178,9 @@
# removed as code is fixed.
4100, 4121, 4125, 4127, 4130, 4131, 4189, 4201, 4238, 4244, 4245,
4310, 4428, 4481, 4505, 4510, 4512, 4530, 4610, 4611, 4701, 4706,
@@ -5377,6 +5380,9 @@
4510, # Default constructor could not be generated
4512, # Assignment operator could not be generated
4610, # Object can never be instantiated
+ # Disable Warning 4702 ("Unreachable code")
+ # https://code.google.com/p/chromium/issues/detail?id=346399#c55
+ 4702,
],
'msvs_settings': {
'VCCLCompilerTool': {
diff --git gyp_chromium gyp_chromium
index b8fe82d..cbc8790 100755
--- gyp_chromium
+++ gyp_chromium
@@ -262,12 +262,6 @@ if __name__ == '__main__':
if sys.platform not in ('darwin',):
args.append('--no-circular-check')
- # We explicitly don't support the make gyp generator (crbug.com/348686). Be
- # nice and fail here, rather than choking in gyp.
- if re.search(r'(^|,|\s)make($|,|\s)', os.environ.get('GYP_GENERATORS', '')):
- print 'Error: make gyp generator not supported (check GYP_GENERATORS).'
- sys.exit(1)
-
# If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
# to enfore syntax checking.
syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK')
diff --git mac/strip_save_dsym mac/strip_save_dsym
index c9cf226..0dedbe3 100755
--- mac/strip_save_dsym
+++ mac/strip_save_dsym
@@ -48,7 +48,7 @@ def macho_archs(macho):
"bundle"]
macho_types_re = "Mach-O (?:64-bit )?(?:" + "|".join(macho_types) + ")"
- file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "--", macho],
+ file_cmd = subprocess.Popen(["/usr/bin/file", "-b", "-L", "--", macho],
stdout=subprocess.PIPE)
archs = []

View File

@ -1,8 +1,8 @@
Index: public/renderer/content_renderer_client.cc
===================================================================
--- public/renderer/content_renderer_client.cc (revision 280796)
+++ public/renderer/content_renderer_client.cc (working copy)
@@ -92,7 +92,6 @@
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
index 6ca2fcc..ed7726d 100644
--- public/renderer/content_renderer_client.cc
+++ public/renderer/content_renderer_client.cc
@@ -92,7 +92,6 @@ bool ContentRendererClient::AllowPopup() {
return false;
}
@ -10,7 +10,7 @@ Index: public/renderer/content_renderer_client.cc
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
DocumentState* document_state,
@@ -104,7 +103,6 @@
@@ -104,7 +103,6 @@ bool ContentRendererClient::HandleNavigation(
bool is_redirect) {
return false;
}
@ -18,11 +18,11 @@ Index: public/renderer/content_renderer_client.cc
bool ContentRendererClient::ShouldFork(blink::WebFrame* frame,
const GURL& url,
Index: public/renderer/content_renderer_client.h
===================================================================
--- public/renderer/content_renderer_client.h (revision 280796)
+++ public/renderer/content_renderer_client.h (working copy)
@@ -176,7 +176,6 @@
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index ada672f..e29e9e0 100644
--- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h
@@ -176,7 +176,6 @@ class CONTENT_EXPORT ContentRendererClient {
// 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
@@ -191,7 +190,6 @@
@@ -191,7 +190,6 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect);
@ -38,23 +38,23 @@ Index: public/renderer/content_renderer_client.h
// Returns true if we should fork a new process for the given navigation.
// If |send_referrer| is set to false (which is the default), no referrer
Index: renderer/render_frame_impl.cc
===================================================================
--- renderer/render_frame_impl.cc (revision 280796)
+++ renderer/render_frame_impl.cc (working copy)
@@ -3122,7 +3122,6 @@
WebNavigationType type,
WebNavigationPolicy default_policy,
bool is_redirect) {
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 10fd5b5..4c88b4d 100644
--- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc
@@ -3380,7 +3380,6 @@ void RenderFrameImpl::FocusedNodeChanged(const WebNode& node) {
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
RenderFrame* render_frame,
const NavigationPolicyInfo& info) {
-#ifdef OS_ANDROID
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (request.url() != GURL(kSwappedOutURL) &&
@@ -3137,7 +3136,6 @@
is_redirect)) {
if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
@@ -3395,7 +3394,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
info.isRedirect)) {
return blink::WebNavigationPolicyIgnore;
}
-#endif
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(frame, request));
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame,
info.urlRequest));

View File

@ -1,7 +1,7 @@
Index: resource_ids
===================================================================
--- resource_ids (revision 280796)
+++ resource_ids (working copy)
diff --git resource_ids resource_ids
index 3b8768e..cde0ceb 100644
--- resource_ids
+++ resource_ids
@@ -16,6 +16,12 @@
{
"SRCDIR": "../..",

View File

@ -1,8 +1,8 @@
Index: gyp/generator/ninja.py
===================================================================
--- gyp/generator/ninja.py (revision 1944)
+++ gyp/generator/ninja.py (working copy)
@@ -740,7 +740,16 @@
diff --git gyp/generator/ninja.py gyp/generator/ninja.py
index 4eafb71..83e629c 100644
--- gyp/generator/ninja.py
+++ gyp/generator/ninja.py
@@ -743,7 +743,16 @@ class NinjaWriter:
for path in copy['files']:
# Normalize the path so trailing slashes don't confuse us.
path = os.path.normpath(path)

View File

@ -1,8 +1,8 @@
Index: message_loop.cc
===================================================================
--- message_loop.cc (revision 280796)
+++ message_loop.cc (working copy)
@@ -154,7 +154,7 @@
diff --git message_loop.cc message_loop.cc
index ae165ea..cbe5c05 100644
--- message_loop.cc
+++ message_loop.cc
@@ -154,7 +154,7 @@ MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current());

View File

@ -1,20 +1,44 @@
Index: public/common/common_param_traits_macros.h
===================================================================
--- public/common/common_param_traits_macros.h (revision 280796)
+++ public/common/common_param_traits_macros.h (working copy)
@@ -175,6 +175,7 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index 56b23e4..04de1dc 100644
--- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h
@@ -172,6 +172,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
IPC_STRUCT_TRAITS_MEMBER(compositor_touch_hit_testing)
+ IPC_STRUCT_TRAITS_MEMBER(base_background_color)
IPC_STRUCT_TRAITS_MEMBER(cookie_enabled)
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
Index: renderer/web_preferences.cc
===================================================================
--- renderer/web_preferences.cc (revision 280796)
+++ renderer/web_preferences.cc (working copy)
@@ -167,6 +167,8 @@
diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index d1e656d..b2ad9e8 100644
--- public/common/web_preferences.cc
+++ public/common/web_preferences.cc
@@ -135,6 +135,7 @@ WebPreferences::WebPreferences()
pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false),
navigate_on_drag_drop(true),
+ base_background_color(0xFFFFFFFF), // Color::white
v8_cache_options(V8_CACHE_OPTIONS_OFF),
cookie_enabled(true),
pepper_accelerated_video_decode_enabled(false)
diff --git public/common/web_preferences.h public/common/web_preferences.h
index 496a347..3916026 100644
--- public/common/web_preferences.h
+++ public/common/web_preferences.h
@@ -141,6 +141,7 @@ struct CONTENT_EXPORT WebPreferences {
int pinch_overlay_scrollbar_thickness;
bool use_solid_color_scrollbars;
bool navigate_on_drag_drop;
+ uint32_t base_background_color;
V8CacheOptions v8_cache_options;
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 743d8db..617ddf4 100644
--- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc
@@ -969,6 +969,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->setJavaEnabled(prefs.java_enabled);

View File

@ -1,24 +0,0 @@
Index: common/webpreferences.cc
===================================================================
--- common/webpreferences.cc (revision 280796)
+++ common/webpreferences.cc (working copy)
@@ -112,6 +112,7 @@
use_solid_color_scrollbars(false),
compositor_touch_hit_testing(true),
navigate_on_drag_drop(true),
+ base_background_color(0xFFFFFFFF), // Color::white
cookie_enabled(true),
pepper_accelerated_video_decode_enabled(false)
#if defined(OS_ANDROID)
Index: common/webpreferences.h
===================================================================
--- common/webpreferences.h (revision 280796)
+++ common/webpreferences.h (working copy)
@@ -148,6 +148,7 @@
bool use_solid_color_scrollbars;
bool compositor_touch_hit_testing;
bool navigate_on_drag_drop;
+ uint32_t base_background_color;
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly

View File

@ -0,0 +1,709 @@
diff --git chrome/renderer/printing/print_web_view_helper.cc chrome/renderer/printing/print_web_view_helper.cc
index f1d4cfd..bb4eac4 100644
--- chrome/renderer/printing/print_web_view_helper.cc
+++ chrome/renderer/printing/print_web_view_helper.cc
@@ -767,12 +767,17 @@ void PrepareFrameAndViewForPrint::FinishPrinting() {
on_ready_.Reset();
}
-PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view)
+PrintWebViewHelper::PrintWebViewHelper(content::RenderView* render_view,
+ bool preview_enabled,
+ bool scripted_print_throttling_disabled)
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<PrintWebViewHelper>(render_view),
reset_prep_frame_view_(false),
+ is_preview_enabled_(preview_enabled),
+ is_scripted_print_throttling_disabled_(scripted_print_throttling_disabled),
is_print_ready_metafile_sent_(false),
ignore_css_margins_(false),
+ user_cancelled_scripted_print_count_(0),
is_scripted_printing_blocked_(false),
notify_browser_of_print_failure_(true),
print_for_preview_(false),
@@ -791,6 +796,14 @@ bool PrintWebViewHelper::IsScriptInitiatedPrintAllowed(
#endif // defined(OS_ANDROID)
if (is_scripted_printing_blocked_)
return false;
+ // If preview is enabled, then the print dialog is tab modal, and the user
+ // can always close the tab on a mis-behaving page (the system print dialog
+ // is app modal). If the print was initiated through user action, don't
+ // throttle. Or, if the command line flag to skip throttling has been set.
+ if (!is_scripted_print_throttling_disabled_ &&
+ !is_preview_enabled_ &&
+ !user_initiated)
+ return !IsScriptInitiatedPrintTooFrequent(frame);
return true;
}
@@ -820,8 +833,14 @@ void PrintWebViewHelper::PrintPage(blink::WebLocalFrame* frame,
if (!IsScriptInitiatedPrintAllowed(frame, user_initiated))
return;
- print_preview_context_.InitWithFrame(frame);
- RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
+ IncrementScriptedPrintCount();
+
+ if (is_preview_enabled_) {
+ print_preview_context_.InitWithFrame(frame);
+ RequestPrintPreview(PRINT_PREVIEW_SCRIPTED);
+ } else {
+ Print(frame, blink::WebNode());
+ }
}
bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
@@ -842,6 +861,7 @@ bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
+ DCHECK(is_preview_enabled_);
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -975,6 +995,7 @@ bool PrintWebViewHelper::IsPrintToPdfRequested(
}
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
+ DCHECK(is_preview_enabled_);
print_preview_context_.OnPrintPreview();
UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
@@ -1177,6 +1198,7 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
}
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
+ DCHECK(is_preview_enabled_);
blink::WebLocalFrame* frame = NULL;
GetPrintFrame(&frame);
DCHECK(frame);
@@ -1210,8 +1232,13 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|.
- print_preview_context_.InitWithNode(node);
- RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE);
+ if (is_preview_enabled_) {
+ print_preview_context_.InitWithNode(node);
+ RequestPrintPreview(PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE);
+ } else {
+ blink::WebNode duplicate_node(node);
+ Print(duplicate_node.document().frame(), duplicate_node);
+ }
print_node_in_progress_ = false;
}
@@ -1248,6 +1275,7 @@ void PrintWebViewHelper::Print(blink::WebLocalFrame* frame,
LOG(ERROR) << "RenderPagesForPrint failed";
DidFinishPrinting(FAIL_PRINT);
}
+ ResetScriptedPrintCount();
}
void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
@@ -1267,6 +1295,7 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
break;
case FAIL_PREVIEW:
+ DCHECK(is_preview_enabled_);
int cookie = print_pages_params_ ?
print_pages_params_->params.document_cookie : 0;
if (notify_browser_of_print_failure_) {
@@ -1435,6 +1464,7 @@ bool PrintWebViewHelper::UpdatePrintSettings(
blink::WebLocalFrame* frame,
const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings) {
+ DCHECK(is_preview_enabled_);
const base::DictionaryValue* job_settings = &passed_job_settings;
base::DictionaryValue modified_job_settings;
if (job_settings->empty()) {
@@ -1588,6 +1618,54 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
}
#endif // defined(OS_POSIX)
+bool PrintWebViewHelper::IsScriptInitiatedPrintTooFrequent(
+ blink::WebFrame* frame) {
+ const int kMinSecondsToIgnoreJavascriptInitiatedPrint = 2;
+ const int kMaxSecondsToIgnoreJavascriptInitiatedPrint = 32;
+ bool too_frequent = false;
+
+ // Check if there is script repeatedly trying to print and ignore it if too
+ // frequent. The first 3 times, we use a constant wait time, but if this
+ // gets excessive, we switch to exponential wait time. So for a page that
+ // calls print() in a loop the user will need to cancel the print dialog
+ // after: [2, 2, 2, 4, 8, 16, 32, 32, ...] seconds.
+ // This gives the user time to navigate from the page.
+ if (user_cancelled_scripted_print_count_ > 0) {
+ base::TimeDelta diff = base::Time::Now() - last_cancelled_script_print_;
+ int min_wait_seconds = kMinSecondsToIgnoreJavascriptInitiatedPrint;
+ if (user_cancelled_scripted_print_count_ > 3) {
+ min_wait_seconds = std::min(
+ kMinSecondsToIgnoreJavascriptInitiatedPrint <<
+ (user_cancelled_scripted_print_count_ - 3),
+ kMaxSecondsToIgnoreJavascriptInitiatedPrint);
+ }
+ if (diff.InSeconds() < min_wait_seconds) {
+ too_frequent = true;
+ }
+ }
+
+ if (!too_frequent)
+ return false;
+
+ blink::WebString message(
+ blink::WebString::fromUTF8("Ignoring too frequent calls to print()."));
+ frame->addMessageToConsole(
+ blink::WebConsoleMessage(
+ blink::WebConsoleMessage::LevelWarning, message));
+ return true;
+}
+
+void PrintWebViewHelper::ResetScriptedPrintCount() {
+ // Reset cancel counter on successful print.
+ user_cancelled_scripted_print_count_ = 0;
+}
+
+void PrintWebViewHelper::IncrementScriptedPrintCount() {
+ ++user_cancelled_scripted_print_count_;
+ last_cancelled_script_print_ = base::Time::Now();
+}
+
+
void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
diff --git chrome/renderer/printing/print_web_view_helper.h chrome/renderer/printing/print_web_view_helper.h
index 67bcc73..b8a5126 100644
--- chrome/renderer/printing/print_web_view_helper.h
+++ chrome/renderer/printing/print_web_view_helper.h
@@ -66,7 +66,9 @@ class PrintWebViewHelper
: public content::RenderViewObserver,
public content::RenderViewObserverTracker<PrintWebViewHelper> {
public:
- explicit PrintWebViewHelper(content::RenderView* render_view);
+ PrintWebViewHelper(content::RenderView* render_view,
+ bool preview_enabled,
+ bool scripted_print_throttling_disabled);
virtual ~PrintWebViewHelper();
bool IsPrintingEnabled();
@@ -292,13 +294,24 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame,
bool user_initiated);
- // Shows scripted print preview when options from plugin are available.
+ // Returns true if script initiated printing occurs too often.
+ bool IsScriptInitiatedPrintTooFrequent(blink::WebFrame* frame);
+
+ // Reset the counter for script initiated printing.
+ // Scripted printing will be allowed to continue.
+ void ResetScriptedPrintCount();
+
+ // Increment the counter for script initiated printing.
+ // Scripted printing will be blocked for a limited amount of time.
+ void IncrementScriptedPrintCount();
+
+ // Shows scripted print preview when options from plugin are availible.
void ShowScriptedPrintPreview();
void RequestPrintPreview(PrintPreviewRequestType type);
// Checks whether print preview should continue or not.
- // Returns true if canceling, false if continuing.
+ // Returns true if cancelling, false if continuing.
bool CheckForCancel();
// Notifies the browser a print preview page has been rendered.
@@ -315,9 +328,14 @@ class PrintWebViewHelper
bool reset_prep_frame_view_;
scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
+ bool is_preview_enabled_;
+ bool is_scripted_print_throttling_disabled_;
bool is_print_ready_metafile_sent_;
bool ignore_css_margins_;
+
// Used for scripted initiated printing blocking.
+ base::Time last_cancelled_script_print_;
+ int user_cancelled_scripted_print_count_;
bool is_scripted_printing_blocked_;
// Let the browser process know of a printing failure. Only set to false when
diff --git printing/printing_context_win.cc printing/printing_context_win.cc
index 4d7ea92..5e53ed2 100644
--- printing/printing_context_win.cc
+++ printing/printing_context_win.cc
@@ -50,7 +50,7 @@ scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) {
}
PrintingContextWin::PrintingContextWin(Delegate* delegate)
- : PrintingContext(delegate), context_(NULL) {
+ : PrintingContext(delegate), context_(NULL), dialog_box_(NULL) {
}
PrintingContextWin::~PrintingContextWin() {
@@ -61,26 +61,63 @@ void PrintingContextWin::AskUserForSettings(
int max_pages,
bool has_selection,
const PrintSettingsCallback& callback) {
- NOTIMPLEMENTED();
+ DCHECK(!in_print_job_);
+ dialog_box_dismissed_ = false;
+
+ HWND window = GetRootWindow(delegate_->GetParentView());
+ DCHECK(window);
+
+ // Show the OS-dependent dialog box.
+ // If the user press
+ // - OK, the settings are reset and reinitialized with the new settings. OK is
+ // returned.
+ // - Apply then Cancel, the settings are reset and reinitialized with the new
+ // settings. CANCEL is returned.
+ // - Cancel, the settings are not changed, the previous setting, if it was
+ // initialized before, are kept. CANCEL is returned.
+ // On failure, the settings are reset and FAILED is returned.
+ PRINTDLGEX dialog_options = { sizeof(PRINTDLGEX) };
+ dialog_options.hwndOwner = window;
+ // Disable options we don't support currently.
+ // TODO(maruel): Reuse the previously loaded settings!
+ dialog_options.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE |
+ PD_NOCURRENTPAGE | PD_HIDEPRINTTOFILE;
+ if (!has_selection)
+ dialog_options.Flags |= PD_NOSELECTION;
+
+ PRINTPAGERANGE ranges[32];
+ dialog_options.nStartPage = START_PAGE_GENERAL;
+ if (max_pages) {
+ // Default initialize to print all the pages.
+ memset(ranges, 0, sizeof(ranges));
+ ranges[0].nFromPage = 1;
+ ranges[0].nToPage = max_pages;
+ dialog_options.nPageRanges = 1;
+ dialog_options.nMaxPageRanges = arraysize(ranges);
+ dialog_options.nMinPage = 1;
+ dialog_options.nMaxPage = max_pages;
+ dialog_options.lpPageRanges = ranges;
+ } else {
+ // No need to bother, we don't know how many pages are available.
+ dialog_options.Flags |= PD_NOPAGENUMS;
+ }
+
+ if (ShowPrintDialog(&dialog_options) != S_OK) {
+ ResetSettings();
+ callback.Run(FAILED);
+ }
+
+ // TODO(maruel): Support PD_PRINTTOFILE.
+ callback.Run(ParseDialogResultEx(dialog_options));
}
PrintingContext::Result PrintingContextWin::UseDefaultSettings() {
DCHECK(!in_print_job_);
- scoped_refptr<PrintBackend> backend = PrintBackend::CreateInstance(NULL);
- base::string16 default_printer =
- base::UTF8ToWide(backend->GetDefaultPrinterName());
- if (!default_printer.empty()) {
- ScopedPrinterHandle printer;
- if (printer.OpenPrinter(default_printer.c_str())) {
- scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode =
- CreateDevMode(printer, NULL);
- if (InitializeSettings(default_printer, dev_mode.get()) == OK)
- return OK;
- }
- }
-
- ReleaseContext();
+ PRINTDLG dialog_options = { sizeof(PRINTDLG) };
+ dialog_options.Flags = PD_RETURNDC | PD_RETURNDEFAULT;
+ if (PrintDlg(&dialog_options))
+ return ParseDialogResult(dialog_options);
// No default printer configured, do we have any printers at all?
DWORD bytes_needed = 0;
@@ -105,15 +142,23 @@ PrintingContext::Result PrintingContextWin::UseDefaultSettings() {
continue;
scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode =
CreateDevMode(printer, NULL);
- if (InitializeSettings(info_2->pPrinterName, dev_mode.get()) == OK)
+ if (!dev_mode || !AllocateContext(info_2->pPrinterName, dev_mode.get(),
+ &context_)) {
+ continue;
+ }
+ if (InitializeSettings(*dev_mode.get(), info_2->pPrinterName, NULL, 0,
+ false)) {
return OK;
+ }
+ ReleaseContext();
}
if (context_)
return OK;
}
}
- return OnError();
+ ResetSettings();
+ return FAILED;
}
gfx::Size PrintingContextWin::GetPdfPaperSizeDeviceUnits() {
@@ -212,14 +257,19 @@ PrintingContext::Result PrintingContextWin::UpdatePrinterSettings(
}
// Update data using DocumentProperties.
- if (show_system_dialog) {
- scoped_dev_mode = ShowPrintDialog(
- printer, delegate_->GetParentView(), scoped_dev_mode.get());
- } else {
- scoped_dev_mode = CreateDevMode(printer, scoped_dev_mode.get());
- }
+ scoped_dev_mode = CreateDevMode(printer, scoped_dev_mode.get());
+ if (!scoped_dev_mode)
+ return OnError();
+
// Set printer then refresh printer settings.
- return InitializeSettings(settings_.device_name(), scoped_dev_mode.get());
+ if (!AllocateContext(settings_.device_name(), scoped_dev_mode.get(),
+ &context_)) {
+ return OnError();
+ }
+ PrintSettingsInitializerWin::InitPrintSettings(context_,
+ *scoped_dev_mode.get(),
+ &settings_);
+ return OK;
}
PrintingContext::Result PrintingContextWin::InitWithSettings(
@@ -230,13 +280,18 @@ PrintingContext::Result PrintingContextWin::InitWithSettings(
// TODO(maruel): settings_.ToDEVMODE()
ScopedPrinterHandle printer;
- if (!printer.OpenPrinter(settings_.device_name().c_str()))
+ if (!printer.OpenPrinter(settings_.device_name().c_str())) {
return FAILED;
+ }
- scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode =
- CreateDevMode(printer, NULL);
+ Result status = OK;
+
+ if (!GetPrinterSettings(printer, settings_.device_name()))
+ status = FAILED;
- return InitializeSettings(settings_.device_name(), dev_mode.get());
+ if (status != OK)
+ ResetSettings();
+ return status;
}
PrintingContext::Result PrintingContextWin::NewDocument(
@@ -320,6 +375,10 @@ void PrintingContextWin::Cancel() {
in_print_job_ = false;
if (context_)
CancelDC(context_);
+ if (dialog_box_) {
+ DestroyWindow(dialog_box_);
+ dialog_box_dismissed_ = true;
+ }
}
void PrintingContextWin::ReleaseContext() {
@@ -343,31 +402,154 @@ BOOL PrintingContextWin::AbortProc(HDC hdc, int nCode) {
return true;
}
-PrintingContext::Result PrintingContextWin::InitializeSettings(
- const std::wstring& device_name,
- DEVMODE* dev_mode) {
- if (!dev_mode)
- return OnError();
+bool PrintingContextWin::InitializeSettings(const DEVMODE& dev_mode,
+ const std::wstring& new_device_name,
+ const PRINTPAGERANGE* ranges,
+ int number_ranges,
+ bool selection_only) {
+ skia::InitializeDC(context_);
+ DCHECK(GetDeviceCaps(context_, CLIPCAPS));
+ DCHECK(GetDeviceCaps(context_, RASTERCAPS) & RC_STRETCHDIB);
+ DCHECK(GetDeviceCaps(context_, RASTERCAPS) & RC_BITMAP64);
+ // Some printers don't advertise these.
+ // DCHECK(GetDeviceCaps(context_, RASTERCAPS) & RC_SCALING);
+ // DCHECK(GetDeviceCaps(context_, SHADEBLENDCAPS) & SB_CONST_ALPHA);
+ // DCHECK(GetDeviceCaps(context_, SHADEBLENDCAPS) & SB_PIXEL_ALPHA);
+
+ // StretchDIBits() support is needed for printing.
+ if (!(GetDeviceCaps(context_, RASTERCAPS) & RC_STRETCHDIB) ||
+ !(GetDeviceCaps(context_, RASTERCAPS) & RC_BITMAP64)) {
+ NOTREACHED();
+ ResetSettings();
+ return false;
+ }
- ReleaseContext();
- context_ = CreateDC(L"WINSPOOL", device_name.c_str(), NULL, dev_mode);
- if (!context_)
- return OnError();
+ DCHECK(!in_print_job_);
+ DCHECK(context_);
+ PageRanges ranges_vector;
+ if (!selection_only) {
+ // Convert the PRINTPAGERANGE array to a PrintSettings::PageRanges vector.
+ ranges_vector.reserve(number_ranges);
+ for (int i = 0; i < number_ranges; ++i) {
+ PageRange range;
+ // Transfer from 1-based to 0-based.
+ range.from = ranges[i].nFromPage - 1;
+ range.to = ranges[i].nToPage - 1;
+ ranges_vector.push_back(range);
+ }
+ }
- skia::InitializeDC(context_);
+ settings_.set_ranges(ranges_vector);
+ settings_.set_device_name(new_device_name);
+ settings_.set_selection_only(selection_only);
+ PrintSettingsInitializerWin::InitPrintSettings(context_, dev_mode,
+ &settings_);
+ return true;
+}
+
+bool PrintingContextWin::GetPrinterSettings(HANDLE printer,
+ const std::wstring& device_name) {
DCHECK(!in_print_job_);
- settings_.set_device_name(device_name);
- PrintSettingsInitializerWin::InitPrintSettings(
- context_, *dev_mode, &settings_);
- return OK;
+ scoped_ptr<DEVMODE, base::FreeDeleter> dev_mode =
+ CreateDevMode(printer, NULL);
+
+ if (!dev_mode || !AllocateContext(device_name, dev_mode.get(), &context_)) {
+ ResetSettings();
+ return false;
+ }
+
+ return InitializeSettings(*dev_mode.get(), device_name, NULL, 0, false);
+}
+
+// static
+bool PrintingContextWin::AllocateContext(const std::wstring& device_name,
+ const DEVMODE* dev_mode,
+ gfx::NativeDrawingContext* context) {
+ *context = CreateDC(L"WINSPOOL", device_name.c_str(), NULL, dev_mode);
+ DCHECK(*context);
+ return *context != NULL;
+}
+
+PrintingContext::Result PrintingContextWin::ParseDialogResultEx(
+ const PRINTDLGEX& dialog_options) {
+ // If the user clicked OK or Apply then Cancel, but not only Cancel.
+ if (dialog_options.dwResultAction != PD_RESULT_CANCEL) {
+ // Start fresh.
+ ResetSettings();
+
+ DEVMODE* dev_mode = NULL;
+ if (dialog_options.hDevMode) {
+ dev_mode =
+ reinterpret_cast<DEVMODE*>(GlobalLock(dialog_options.hDevMode));
+ DCHECK(dev_mode);
+ }
+
+ std::wstring device_name;
+ if (dialog_options.hDevNames) {
+ DEVNAMES* dev_names =
+ reinterpret_cast<DEVNAMES*>(GlobalLock(dialog_options.hDevNames));
+ DCHECK(dev_names);
+ if (dev_names) {
+ device_name = reinterpret_cast<const wchar_t*>(dev_names) +
+ dev_names->wDeviceOffset;
+ GlobalUnlock(dialog_options.hDevNames);
+ }
+ }
+
+ bool success = false;
+ if (dev_mode && !device_name.empty()) {
+ context_ = dialog_options.hDC;
+ PRINTPAGERANGE* page_ranges = NULL;
+ DWORD num_page_ranges = 0;
+ bool print_selection_only = false;
+ if (dialog_options.Flags & PD_PAGENUMS) {
+ page_ranges = dialog_options.lpPageRanges;
+ num_page_ranges = dialog_options.nPageRanges;
+ }
+ if (dialog_options.Flags & PD_SELECTION) {
+ print_selection_only = true;
+ }
+ success = InitializeSettings(*dev_mode,
+ device_name,
+ page_ranges,
+ num_page_ranges,
+ print_selection_only);
+ }
+
+ if (!success && dialog_options.hDC) {
+ DeleteDC(dialog_options.hDC);
+ context_ = NULL;
+ }
+
+ if (dev_mode) {
+ GlobalUnlock(dialog_options.hDevMode);
+ }
+ } else {
+ if (dialog_options.hDC) {
+ DeleteDC(dialog_options.hDC);
+ }
+ }
+
+ if (dialog_options.hDevMode != NULL)
+ GlobalFree(dialog_options.hDevMode);
+ if (dialog_options.hDevNames != NULL)
+ GlobalFree(dialog_options.hDevNames);
+
+ switch (dialog_options.dwResultAction) {
+ case PD_RESULT_PRINT:
+ return context_ ? OK : FAILED;
+ case PD_RESULT_APPLY:
+ return context_ ? CANCEL : FAILED;
+ case PD_RESULT_CANCEL:
+ return CANCEL;
+ default:
+ return FAILED;
+ }
}
-scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog(
- HANDLE printer,
- gfx::NativeView parent_view,
- DEVMODE* dev_mode) {
+HRESULT PrintingContextWin::ShowPrintDialog(PRINTDLGEX* options) {
// Note that this cannot use ui::BaseShellDialog as the print dialog is
// system modal: opening it from a background thread can cause Windows to
// get the wrong Z-order which will make the print dialog appear behind the
@@ -377,20 +559,57 @@ scoped_ptr<DEVMODE, base::FreeDeleter> PrintingContextWin::ShowPrintDialog(
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
- bool canceled = false;
- scoped_ptr<DEVMODE, base::FreeDeleter> result =
- PromptDevMode(printer,
- settings_.device_name(),
- dev_mode,
- GetRootWindow(parent_view),
- &canceled);
-
- if (canceled) {
- result.reset();
- abort_printing_ = true;
+ return PrintDlgEx(options);
+}
+
+PrintingContext::Result PrintingContextWin::ParseDialogResult(
+ const PRINTDLG& dialog_options) {
+ // If the user clicked OK or Apply then Cancel, but not only Cancel.
+ // Start fresh.
+ ResetSettings();
+
+ DEVMODE* dev_mode = NULL;
+ if (dialog_options.hDevMode) {
+ dev_mode =
+ reinterpret_cast<DEVMODE*>(GlobalLock(dialog_options.hDevMode));
+ DCHECK(dev_mode);
}
- return result.Pass();
+ std::wstring device_name;
+ if (dialog_options.hDevNames) {
+ DEVNAMES* dev_names =
+ reinterpret_cast<DEVNAMES*>(GlobalLock(dialog_options.hDevNames));
+ DCHECK(dev_names);
+ if (dev_names) {
+ device_name =
+ reinterpret_cast<const wchar_t*>(
+ reinterpret_cast<const wchar_t*>(dev_names) +
+ dev_names->wDeviceOffset);
+ GlobalUnlock(dialog_options.hDevNames);
+ }
+ }
+
+ bool success = false;
+ if (dev_mode && !device_name.empty()) {
+ context_ = dialog_options.hDC;
+ success = InitializeSettings(*dev_mode, device_name, NULL, 0, false);
+ }
+
+ if (!success && dialog_options.hDC) {
+ DeleteDC(dialog_options.hDC);
+ context_ = NULL;
+ }
+
+ if (dev_mode) {
+ GlobalUnlock(dialog_options.hDevMode);
+ }
+
+ if (dialog_options.hDevMode != NULL)
+ GlobalFree(dialog_options.hDevMode);
+ if (dialog_options.hDevNames != NULL)
+ GlobalFree(dialog_options.hDevNames);
+
+ return context_ ? OK : FAILED;
}
} // namespace printing
diff --git printing/printing_context_win.h printing/printing_context_win.h
index 99a7e3e..f6222ad 100644
--- printing/printing_context_win.h
+++ printing/printing_context_win.h
@@ -40,24 +40,45 @@ class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
virtual void ReleaseContext() OVERRIDE;
virtual gfx::NativeDrawingContext context() const OVERRIDE;
+ // Allocates the HDC for a specific DEVMODE.
+ static bool AllocateContext(const std::wstring& printer_name,
+ const DEVMODE* dev_mode,
+ gfx::NativeDrawingContext* context);
+
protected:
- virtual scoped_ptr<DEVMODE, base::FreeDeleter> ShowPrintDialog(
- HANDLE printer,
- gfx::NativeView parent_view,
- DEVMODE* dev_mode);
+ virtual HRESULT ShowPrintDialog(PRINTDLGEX* options);
private:
+ // Class that manages the PrintDlgEx() callbacks. This is meant to be a
+ // temporary object used during the Print... dialog display.
+ class CallbackHandler;
+
// Used in response to the user canceling the printing.
static BOOL CALLBACK AbortProc(HDC hdc, int nCode);
// Reads the settings from the selected device context. Updates settings_ and
// its margins.
- virtual Result InitializeSettings(const base::string16& device_name,
- DEVMODE* dev_mode);
+ bool InitializeSettings(const DEVMODE& dev_mode,
+ const std::wstring& new_device_name,
+ const PRINTPAGERANGE* ranges,
+ int number_ranges,
+ bool selection_only);
+
+ // Retrieves the printer's default low-level settings. On Windows, context_ is
+ // allocated with this call.
+ bool GetPrinterSettings(HANDLE printer,
+ const std::wstring& device_name);
+
+ // Parses the result of a PRINTDLGEX result.
+ Result ParseDialogResultEx(const PRINTDLGEX& dialog_options);
+ Result ParseDialogResult(const PRINTDLG& dialog_options);
// The selected printer context.
HDC context_;
+ // The dialog box for the time it is shown.
+ volatile HWND dialog_box_;
+
DISALLOW_COPY_AND_ASSIGN(PrintingContextWin);
};

View File

@ -1,8 +1,8 @@
Index: content_browser_client.cc
===================================================================
--- content_browser_client.cc (revision 280796)
+++ content_browser_client.cc (working copy)
@@ -280,6 +280,10 @@
diff --git content_browser_client.cc content_browser_client.cc
index d982b69..9272897 100644
--- content_browser_client.cc
+++ content_browser_client.cc
@@ -276,6 +276,10 @@ bool ContentBrowserClient::IsFastShutdownPossible() {
return true;
}
@ -13,19 +13,19 @@ Index: content_browser_client.cc
base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
return base::FilePath();
}
Index: content_browser_client.h
===================================================================
--- content_browser_client.h (revision 280796)
+++ content_browser_client.h (working copy)
@@ -23,6 +23,7 @@
diff --git content_browser_client.h content_browser_client.h
index f8253a6..d82c177 100644
--- content_browser_client.h
+++ content_browser_client.h
@@ -25,6 +25,7 @@
#include "net/cookies/canonical_cookie.h"
#include "net/url_request/url_request_interceptor.h"
#include "net/url_request/url_request_job_factory.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/public/web/WebNotificationPresenter.h"
#include "third_party/WebKit/public/platform/WebNotificationPermission.h"
#include "ui/base/window_open_disposition.h"
#include "webkit/browser/fileapi/file_system_context.h"
@@ -538,6 +539,9 @@
@@ -526,6 +527,9 @@ class CONTENT_EXPORT ContentBrowserClient {
// Clears browser cookies.
virtual void ClearCookies(RenderViewHost* rvh) {}
@ -35,11 +35,11 @@ Index: content_browser_client.h
// Returns the default download directory.
// This can be called on any thread.
virtual base::FilePath GetDefaultDownloadDirectory();
Index: web_contents.cc
===================================================================
--- web_contents.cc (revision 280796)
+++ web_contents.cc (working copy)
@@ -17,7 +17,9 @@
diff --git web_contents.cc web_contents.cc
index 7afc338..c014439 100644
--- web_contents.cc
+++ web_contents.cc
@@ -17,7 +17,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context)
main_frame_routing_id(MSG_ROUTING_NONE),
initially_hidden(false),
guest_delegate(NULL),
@ -50,7 +50,7 @@ Index: web_contents.cc
WebContents::CreateParams::CreateParams(
BrowserContext* context, SiteInstance* site)
@@ -29,7 +31,9 @@
@@ -29,7 +31,9 @@ WebContents::CreateParams::CreateParams(
main_frame_routing_id(MSG_ROUTING_NONE),
initially_hidden(false),
guest_delegate(NULL),
@ -61,11 +61,11 @@ Index: web_contents.cc
WebContents::CreateParams::~CreateParams() {
}
Index: web_contents.h
===================================================================
--- web_contents.h (revision 280796)
+++ web_contents.h (working copy)
@@ -51,9 +51,11 @@
diff --git web_contents.h web_contents.h
index 80766dc..025c8c7 100644
--- web_contents.h
+++ web_contents.h
@@ -52,9 +52,11 @@ class PageState;
class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
@ -77,7 +77,7 @@ Index: web_contents.h
struct CustomContextMenuContext;
struct DropData;
struct RendererPreferences;
@@ -116,6 +118,10 @@
@@ -117,6 +119,10 @@ class WebContents : public PageNavigator,
// Used to specify the location context which display the new view should
// belong. This can be NULL if not needed.
gfx::NativeView context;
@ -88,11 +88,11 @@ Index: web_contents.h
};
// Creates a new WebContents.
Index: web_contents_delegate.cc
===================================================================
--- web_contents_delegate.cc (revision 280796)
+++ web_contents_delegate.cc (working copy)
@@ -136,7 +136,9 @@
diff --git web_contents_delegate.cc web_contents_delegate.cc
index 0028339..477040e 100644
--- web_contents_delegate.cc
+++ web_contents_delegate.cc
@@ -136,7 +136,9 @@ bool WebContentsDelegate::ShouldCreateWebContents(
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
@ -103,11 +103,11 @@ Index: web_contents_delegate.cc
return true;
}
Index: web_contents_delegate.h
===================================================================
--- web_contents_delegate.h (revision 280796)
+++ web_contents_delegate.h (working copy)
@@ -36,9 +36,11 @@
diff --git web_contents_delegate.h web_contents_delegate.h
index b9aa02d..d840775 100644
--- web_contents_delegate.h
+++ web_contents_delegate.h
@@ -37,9 +37,11 @@ class DownloadItem;
class JavaScriptDialogManager;
class PageState;
class RenderViewHost;
@ -119,7 +119,7 @@ Index: web_contents_delegate.h
struct ColorSuggestion;
struct ContextMenuParams;
struct DropData;
@@ -312,7 +314,9 @@
@@ -312,7 +314,9 @@ class CONTENT_EXPORT WebContentsDelegate {
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,

View File

@ -1,8 +1,8 @@
Index: compositing_iosurface_layer_mac.mm
===================================================================
--- compositing_iosurface_layer_mac.mm (revision 280796)
+++ compositing_iosurface_layer_mac.mm (working copy)
@@ -191,7 +191,7 @@
diff --git compositing_iosurface_layer_mac.mm compositing_iosurface_layer_mac.mm
index 81a3529..dfcc48d 100644
--- compositing_iosurface_layer_mac.mm
+++ compositing_iosurface_layer_mac.mm
@@ -268,7 +268,7 @@ void CompositingIOSurfaceLayerHelper::EndPumpingFrames() {
TRACE_EVENT0("browser", "CompositingIOSurfaceLayer::drawInCGLContext");
if (!iosurface_->HasIOSurface() || context_->cgl_context() != glContext) {
@ -11,12 +11,12 @@ Index: compositing_iosurface_layer_mac.mm
glClear(GL_COLOR_BUFFER_BIT);
return;
}
Index: compositing_iosurface_mac.mm
===================================================================
--- compositing_iosurface_mac.mm (revision 280796)
+++ compositing_iosurface_mac.mm (working copy)
@@ -350,7 +350,7 @@
glUseProgram(0); CHECK_AND_SAVE_GL_ERROR();
diff --git compositing_iosurface_mac.mm compositing_iosurface_mac.mm
index 7012399..47cb9d1 100644
--- compositing_iosurface_mac.mm
+++ compositing_iosurface_mac.mm
@@ -167,7 +167,7 @@ bool CompositingIOSurfaceMac::DrawIOSurface(
CHECK_AND_SAVE_GL_ERROR();
} else {
// Should match the clear color of RenderWidgetHostViewMac.
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
@ -24,79 +24,11 @@ Index: compositing_iosurface_mac.mm
glClear(GL_COLOR_BUFFER_BIT);
}
Index: compositing_iosurface_shader_programs_mac.cc
===================================================================
--- compositing_iosurface_shader_programs_mac.cc (revision 280796)
+++ compositing_iosurface_shader_programs_mac.cc (working copy)
@@ -11,6 +11,8 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/stringprintf.h"
+#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "gpu/config/gpu_driver_bug_workaround_type.h"
@@ -51,6 +53,7 @@
}
);
+float bgcolor[] = {1.0f, 1.0f, 1.0f};
// Only calculates position.
const char kvsSolidWhite[] = GLSL_PROGRAM_AS_STRING(
@@ -238,6 +241,18 @@
const GLuint shader = glCreateShader(shader_type);
DCHECK_NE(shader, 0u);
+ // Support customization of the background color.
+ std::string bg_shader;
+ if (shader_program == SHADER_PROGRAM_SOLID_WHITE &&
+ shader_type == GL_FRAGMENT_SHADER) {
+ bg_shader = base::StringPrintf(
+ "void main() { gl_FragColor = vec4(%s, %s, %s, 1.0); }",
+ base::DoubleToString(bgcolor[0]).c_str(),
+ base::DoubleToString(bgcolor[1]).c_str(),
+ base::DoubleToString(bgcolor[2]).c_str());
+ kFragmentShaderSourceCodeMap[shader_program] = bg_shader.c_str();
+ }
+
// Select and compile the shader program source code.
if (shader_type == GL_VERTEX_SHADER) {
const GLchar* source_snippets[] = {
@@ -412,6 +427,14 @@
Reset();
}
+// static
+void CompositingIOSurfaceShaderPrograms::SetBackgroundColor(
+ float r, float g, float b) {
+ bgcolor[0] = r;
+ bgcolor[1] = g;
+ bgcolor[2] = b;
+}
+
GLuint CompositingIOSurfaceShaderPrograms::GetShaderProgram(int which) {
if (shader_programs_[which] == 0u) {
shader_programs_[which] =
Index: compositing_iosurface_shader_programs_mac.h
===================================================================
--- compositing_iosurface_shader_programs_mac.h (revision 280796)
+++ compositing_iosurface_shader_programs_mac.h (working copy)
@@ -48,6 +48,8 @@
return rgb_to_yv12_output_format_;
}
+ static void SetBackgroundColor(float r, float g, float b);
+
protected:
FRIEND_TEST_ALL_PREFIXES(CompositingIOSurfaceTransformerTest,
TransformsRGBToYV12);
Index: render_widget_host_view_aura.cc
===================================================================
--- render_widget_host_view_aura.cc (revision 280796)
+++ render_widget_host_view_aura.cc (working copy)
@@ -1672,8 +1672,14 @@
diff --git render_widget_host_view_aura.cc render_widget_host_view_aura.cc
index 49ee8e4..c49ef82 100644
--- render_widget_host_view_aura.cc
+++ render_widget_host_view_aura.cc
@@ -1615,8 +1615,14 @@ void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
// For non-opaque windows, we don't draw anything, since we depend on the
// canvas coming from the compositor to already be initialized as
// transparent.
@ -113,16 +45,16 @@ Index: render_widget_host_view_aura.cc
}
void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
Index: render_widget_host_view_mac.mm
===================================================================
--- render_widget_host_view_mac.mm (revision 280796)
+++ render_widget_host_view_mac.mm (working copy)
@@ -504,7 +504,7 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index 4ebbd62..7b3983a 100644
--- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm
@@ -507,7 +507,7 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget)
// draw.
background_layer_.reset([[CALayer alloc] init]);
[background_layer_
- setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
[background_layer_ setGeometryFlipped:YES];
[background_layer_ setContentsGravity:kCAGravityTopLeft];
[cocoa_view_ setLayer:background_layer_];
[cocoa_view_ setWantsLayer:YES];

View File

@ -1,8 +1,8 @@
Index: core/frame/FrameView.cpp
===================================================================
--- core/frame/FrameView.cpp (revision 177271)
+++ core/frame/FrameView.cpp (working copy)
@@ -139,8 +139,10 @@
diff --git core/frame/FrameView.cpp core/frame/FrameView.cpp
index 5d42bda..70e70a6 100644
--- core/frame/FrameView.cpp
+++ core/frame/FrameView.cpp
@@ -126,8 +126,10 @@ FrameView::FrameView(LocalFrame* frame)
if (!m_frame->isMainFrame())
return;
@ -13,11 +13,11 @@ Index: core/frame/FrameView.cpp
}
PassRefPtr<FrameView> FrameView::create(LocalFrame* frame)
Index: platform/scroll/ScrollbarThemeMacCommon.mm
===================================================================
--- platform/scroll/ScrollbarThemeMacCommon.mm (revision 177271)
+++ platform/scroll/ScrollbarThemeMacCommon.mm (working copy)
@@ -355,10 +355,14 @@
diff --git platform/scroll/ScrollbarThemeMacCommon.mm platform/scroll/ScrollbarThemeMacCommon.mm
index 309e1e3..b40a19a 100644
--- platform/scroll/ScrollbarThemeMacCommon.mm
+++ platform/scroll/ScrollbarThemeMacCommon.mm
@@ -355,10 +355,14 @@ NSScrollerStyle ScrollbarThemeMacCommon::recommendedScrollerStyle()
// static
bool ScrollbarThemeMacCommon::isOverlayAPIAvailable()
{
@ -31,4 +31,4 @@ Index: platform/scroll/ScrollbarThemeMacCommon.mm
+#endif
}
} // namespace WebCore
} // namespace blink

View File

@ -1,8 +1,8 @@
Index: os_exchange_data_provider_aurax11.cc
===================================================================
--- os_exchange_data_provider_aurax11.cc (revision 280796)
+++ os_exchange_data_provider_aurax11.cc (working copy)
@@ -155,7 +155,8 @@
diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc
index 714069f..56c7fa5 100644
--- os_exchange_data_provider_aurax11.cc
+++ os_exchange_data_provider_aurax11.cc
@@ -158,7 +158,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,
format_map_.Insert(atom_cache_.GetAtom(kMimeTypeMozillaURL), mem);
// Set a string fallback as well.

View File

@ -1,11 +1,11 @@
Index: underlay_opengl_hosting_window.h
===================================================================
--- underlay_opengl_hosting_window.h (revision 280796)
+++ underlay_opengl_hosting_window.h (working copy)
diff --git underlay_opengl_hosting_window.h underlay_opengl_hosting_window.h
index d673c31..806d134 100644
--- underlay_opengl_hosting_window.h
+++ underlay_opengl_hosting_window.h
@@ -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.
// the window. Previously contained methods related to hole punching, now just
// contains common asserts.
-UI_BASE_EXPORT
+__attribute__((visibility("default")))
@interface UnderlayOpenGLHostingWindow : NSWindow

View File

@ -1,8 +1,8 @@
Index: desktop_aura/desktop_screen_win.cc
===================================================================
--- desktop_aura/desktop_screen_win.cc (revision 280796)
+++ desktop_aura/desktop_screen_win.cc (working copy)
@@ -54,6 +54,8 @@
diff --git desktop_aura/desktop_screen_win.cc desktop_aura/desktop_screen_win.cc
index aede179..abad021 100644
--- desktop_aura/desktop_screen_win.cc
+++ desktop_aura/desktop_screen_win.cc
@@ -36,6 +36,8 @@ gfx::Display DesktopScreenWin::GetDisplayMatching(
}
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
@ -11,11 +11,11 @@ Index: desktop_aura/desktop_screen_win.cc
aura::WindowTreeHost* host = window->GetHost();
return host ? host->GetAcceleratedWidget() : NULL;
}
Index: desktop_aura/desktop_screen_x11.cc
===================================================================
--- desktop_aura/desktop_screen_x11.cc (revision 280796)
+++ desktop_aura/desktop_screen_x11.cc (working copy)
@@ -220,6 +220,9 @@
diff --git desktop_aura/desktop_screen_x11.cc desktop_aura/desktop_screen_x11.cc
index f4c03da..bb253cf 100644
--- desktop_aura/desktop_screen_x11.cc
+++ desktop_aura/desktop_screen_x11.cc
@@ -157,6 +157,9 @@ std::vector<gfx::Display> DesktopScreenX11::GetAllDisplays() const {
gfx::Display DesktopScreenX11::GetDisplayNearestWindow(
gfx::NativeView window) const {
@ -25,11 +25,11 @@ Index: desktop_aura/desktop_screen_x11.cc
// Getting screen bounds here safely is hard.
//
// You'd think we'd be able to just call window->GetBoundsInScreen(), but we
Index: desktop_aura/desktop_window_tree_host_win.cc
===================================================================
--- desktop_aura/desktop_window_tree_host_win.cc (revision 280796)
+++ desktop_aura/desktop_window_tree_host_win.cc (working copy)
@@ -129,7 +129,9 @@
diff --git desktop_aura/desktop_window_tree_host_win.cc desktop_aura/desktop_window_tree_host_win.cc
index 877e8d1..d3a03c6 100644
--- desktop_aura/desktop_window_tree_host_win.cc
+++ desktop_aura/desktop_window_tree_host_win.cc
@@ -129,7 +129,9 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window,
native_widget_delegate_);
HWND parent_hwnd = NULL;
@ -40,7 +40,7 @@ Index: desktop_aura/desktop_window_tree_host_win.cc
parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
@@ -770,6 +772,7 @@
@@ -769,6 +771,7 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
// TODO(beng): inform the native_widget_delegate_.
@ -48,7 +48,7 @@ Index: desktop_aura/desktop_window_tree_host_win.cc
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnFocus();
@@ -777,6 +780,7 @@
@@ -776,6 +779,7 @@ void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
void DesktopWindowTreeHostWin::HandleNativeBlur(HWND focused_window) {
// TODO(beng): inform the native_widget_delegate_.
@ -56,11 +56,11 @@ Index: desktop_aura/desktop_window_tree_host_win.cc
InputMethod* input_method = GetInputMethod();
if (input_method)
input_method->OnBlur();
Index: desktop_aura/desktop_window_tree_host_x11.cc
===================================================================
--- desktop_aura/desktop_window_tree_host_x11.cc (revision 280796)
+++ desktop_aura/desktop_window_tree_host_x11.cc (working copy)
@@ -148,7 +148,8 @@
diff --git desktop_aura/desktop_window_tree_host_x11.cc desktop_aura/desktop_window_tree_host_x11.cc
index 03b2cfb..c15798a 100644
--- desktop_aura/desktop_window_tree_host_x11.cc
+++ desktop_aura/desktop_window_tree_host_x11.cc
@@ -146,7 +146,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
window_parent_(NULL),
window_shape_(NULL),
custom_window_shape_(false),
@ -70,7 +70,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
}
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
@@ -347,7 +348,8 @@
@@ -349,7 +350,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources.
if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@ -80,7 +80,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed();
@@ -443,6 +445,8 @@
@@ -446,6 +448,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
}
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -89,7 +89,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
return bounds_;
}
@@ -455,6 +459,8 @@
@@ -458,6 +462,8 @@ gfx::Rect DesktopWindowTreeHostX11::GetClientAreaBoundsInScreen() const {
// Attempts to calculate the rect by asking the NonClientFrameView what it
// thought its GetBoundsForClientView() were broke combobox drop down
// placement.
@ -98,7 +98,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
return bounds_;
}
@@ -899,6 +905,8 @@
@@ -924,6 +930,8 @@ void DesktopWindowTreeHostX11::SetBounds(const gfx::Rect& requested_bounds) {
}
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
@ -107,7 +107,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
return bounds_.origin();
}
@@ -1042,9 +1050,13 @@
@@ -1072,10 +1080,14 @@ void DesktopWindowTreeHostX11::InitX11Window(
}
}
@ -115,14 +115,15 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
+ if (parent_widget == gfx::kNullAcceleratedWidget)
+ parent_widget = x_root_window_;
+
bounds_ = params.bounds;
bounds_ = gfx::Rect(params.bounds.origin(),
AdjustSize(params.bounds.size()));
xwindow_ = XCreateWindow(
- xdisplay_, x_root_window_,
+ xdisplay_, parent_widget,
bounds_.x(), bounds_.y(),
bounds_.width(), bounds_.height(),
0, // border width
@@ -1600,6 +1612,10 @@
@@ -1678,6 +1690,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
}
break;
}
@ -133,11 +134,11 @@ Index: desktop_aura/desktop_window_tree_host_x11.cc
case FocusOut:
if (xev->xfocus.mode != NotifyGrab) {
ReleaseCapture();
Index: desktop_aura/desktop_window_tree_host_x11.h
===================================================================
--- desktop_aura/desktop_window_tree_host_x11.h (revision 280796)
+++ desktop_aura/desktop_window_tree_host_x11.h (working copy)
@@ -84,6 +84,8 @@
diff --git desktop_aura/desktop_window_tree_host_x11.h desktop_aura/desktop_window_tree_host_x11.h
index 1c08221..f0ae19f 100644
--- desktop_aura/desktop_window_tree_host_x11.h
+++ desktop_aura/desktop_window_tree_host_x11.h
@@ -85,6 +85,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Deallocates the internal list of open windows.
static void CleanUpWindowList();
@ -146,7 +147,7 @@ Index: desktop_aura/desktop_window_tree_host_x11.h
protected:
// Overridden from DesktopWindowTreeHost:
virtual void Init(aura::Window* content_window,
@@ -250,6 +252,9 @@
@@ -257,6 +259,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|.
gfx::Rect bounds_;
@ -156,9 +157,9 @@ Index: desktop_aura/desktop_window_tree_host_x11.h
// Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real |restored_bounds_|. Window
// managers tend to send a Configure message with the maximized bounds, and
@@ -331,6 +336,9 @@
// the frame when |xwindow_| gains focus or handles a mouse button event.
bool urgency_hint_set_;
@@ -336,6 +341,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::CancelableCallback<void()> delayed_resize_task_;
+ // True if the xwindow has already been destroyed.
+ bool xwindow_destroyed_;
@ -166,11 +167,11 @@ Index: desktop_aura/desktop_window_tree_host_x11.h
DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
};
Index: widget.cc
===================================================================
--- widget.cc (revision 280796)
+++ widget.cc (working copy)
@@ -116,6 +116,7 @@
diff --git widget.cc widget.cc
index d4b16bb..5af6aa1 100644
--- widget.cc
+++ widget.cc
@@ -116,6 +116,7 @@ Widget::InitParams::InitParams()
show_state(ui::SHOW_STATE_DEFAULT),
double_buffer(false),
parent(NULL),
@ -178,7 +179,7 @@ Index: widget.cc
native_widget(NULL),
desktop_window_tree_host(NULL),
layer_type(aura::WINDOW_LAYER_TEXTURED),
@@ -140,6 +141,7 @@
@@ -140,6 +141,7 @@ Widget::InitParams::InitParams(Type type)
show_state(ui::SHOW_STATE_DEFAULT),
double_buffer(false),
parent(NULL),
@ -186,7 +187,7 @@ Index: widget.cc
native_widget(NULL),
desktop_window_tree_host(NULL),
layer_type(aura::WINDOW_LAYER_TEXTURED),
@@ -314,7 +316,7 @@
@@ -314,7 +316,7 @@ void Widget::Init(const InitParams& in_params) {
InitParams params = in_params;
params.child |= (params.type == InitParams::TYPE_CONTROL);
@ -195,7 +196,7 @@ Index: widget.cc
if (params.opacity == views::Widget::InitParams::INFER_OPACITY &&
params.type != views::Widget::InitParams::TYPE_WINDOW &&
@@ -375,7 +377,12 @@
@@ -375,7 +377,12 @@ void Widget::Init(const InitParams& in_params) {
Minimize();
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
@ -209,11 +210,11 @@ Index: widget.cc
}
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
Index: widget.h
===================================================================
--- widget.h (revision 280796)
+++ widget.h (working copy)
@@ -222,6 +222,7 @@
diff --git widget.h widget.h
index fad5506..7828ced 100644
--- widget.h
+++ widget.h
@@ -225,6 +225,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// Should the widget be double buffered? Default is false.
bool double_buffer;
gfx::NativeView parent;

View File

@ -1,13 +0,0 @@
Index: WebNode.cpp
===================================================================
--- WebNode.cpp (revision 177271)
+++ WebNode.cpp (working copy)
@@ -173,7 +173,7 @@
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
// Please do not add more eventTypes to this list without an API review.
- RELEASE_ASSERT(eventType == "mousedown");
+ // RELEASE_ASSERT(eventType == "mousedown");
EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
// The listenerWrapper is only referenced by the actual Node. Once it goes

Some files were not shown because too many files have changed in this diff Show More