Create 1916 release branch for CEF3.

git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1916@1654 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-04-11 21:13:32 +00:00
parent 32e5746c59
commit d6f47eba76
928 changed files with 159573 additions and 0 deletions

20
patch/README.txt Normal file
View File

@@ -0,0 +1,20 @@
There may be instances where CEF requires changes to the Chromium/WebKit code
base that are not desired by the Chromium/WebKit projects as a whole. To address
this situation the CEF project adds a patch capability as part of the CEF GYP
project generation step. The patch capability works as follows:
1. The CEF developer creates one or more patch files containing all required
changes to the Chromium/WebKit code base and places those patch files in the
"patches" subdirectory.
2. The CEF developer adds an entry for each patch file in the "patch.cfg" file.
3. CEF applies the patches to the Chromium/WebKit source tree using the
patcher.py tool in the tools directory. If necessary the patcher.py tool
also rewrites the "patch_state.h" file which defines the CEF_PATCHES_APPLIED
preprocessor value.
To disable automatic application of patches to the Chromium/WebKit code base
create an empty "NOPATCH" file in the "patch" directory. Sections of the CEF
code base that otherwise require patches will be disabled using the
CEF_PATCHES_APPLIED preprocessor value defined in the "patch_state.h" file. Be
warned that not applying all required patches may break important CEF
functionality.

108
patch/patch.cfg Normal file
View File

@@ -0,0 +1,108 @@
# Each map in the list associates a patch file name with a target path and
# optional condition. All paths in the patch file must be relative to the
# target path. Each map should include a comment linking to the code review
# or bug report that the patch relates to. If a condition is provided the
# patch will only be applied if an environment variable with the specified
# name exists.
patches = [
{
# Necessary for grit integration
'name': 'gritsettings',
'path': '../tools/gritsettings/',
},
{
# Fix Xcode 4 build on OS X Lion.
# http://codereview.chromium.org/8086022/
#
# Don't use aura on Linux.
'name': 'build',
'path': '../build/',
},
{
# Support loading of password protected zip archives.
# http://code.google.com/p/chromiumembedded/issues/detail?id=496
'name': 'zlib',
'path': '../third_party/zlib/',
},
{
# Avoid MessageLoop assertion on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=443
'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
'name': 'gyp_331',
'path': '../tools/gyp/pylib/',
},
{
# Enable popups in offscreen rendering on OS X.
'name': 'webkit_popups',
'path': '../third_party/WebKit/',
},
{
# Fix export of UnderlayOpenGLHostingWindow for 64-bit OS X builds.
# http://code.google.com/p/chromiumembedded/issues/detail?id=1051
'name': 'underlay_1051',
'path': '../ui/base/cocoa/',
},
{
# Allow specification of a parent window handle for Widget creation.
# https://code.google.com/p/chromiumembedded/issues/detail?id=180
'name': 'views_widget_180',
'path': '../ui/views/widget/',
},
{
# Allow continued use of ContentRendererClient::HandleNavigation.
# https://code.google.com/p/chromiumembedded/issues/detail?id=1129
'name': 'content_nav_1129',
'path': '../content/',
},
{
# Allow customization of the background color on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=1161
'name': 'renderer_host_1161',
'path': '../content/browser/renderer_host/',
},
{
# Allow customization of the WebView background color.
# http://code.google.com/p/chromiumembedded/issues/detail?id=1161
# https://codereview.chromium.org/228603007/
'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/',
},
{
# Pass RenderFrameHost to WebContentsDelegate::HandleContextMenu.
# https://codereview.chromium.org/148843003/
'name': 'web_contents_304341',
'path': '../content/',
},
{
# Pass RenderFrameHost to WebContentsDelegate::HandleContextMenu.
# https://codereview.chromium.org/148843003/
'name': 'views_webview_304341',
'path': '../ui/views/controls/webview/',
},
{
# Disable scollbar bounce and overlay on OS X.
# http://code.google.com/p/chromiumembedded/issues/detail?id=364
'name': 'spi_webcore_364',
'path': '../third_party/WebKit/Source/',
'condition': 'CEF_SPI_BUILD',
},
]

40
patch/patches/build.patch Normal file
View File

@@ -0,0 +1,40 @@
Index: common.gypi
===================================================================
--- common.gypi (revision 261035)
+++ common.gypi (working copy)
@@ -9,6 +9,9 @@
# Variables expected to be overriden on the GYP command line (-D) or by
# ~/.gyp/include.gypi.
'variables': {
+ # Directory for CEF source files. This will be set by cef.gypi.
+ 'cef_directory%' : '',
+
# 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
@@ -101,9 +104,9 @@
#
# TODO(erg): Merge this into the previous block once compiling with
# aura safely implies including ash capabilities.
- ['OS=="linux"', {
- 'use_aura%': 1,
- }],
+ #['OS=="linux"', {
+ # 'use_aura%': 1,
+ #}],
# Whether we're a traditional desktop unix.
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
Index: mac/strip_save_dsym
===================================================================
--- mac/strip_save_dsym (revision 261035)
+++ 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 = []

View File

@@ -0,0 +1,60 @@
Index: public/renderer/content_renderer_client.cc
===================================================================
--- public/renderer/content_renderer_client.cc (revision 262261)
+++ public/renderer/content_renderer_client.cc (working copy)
@@ -92,7 +92,6 @@
return false;
}
-#ifdef OS_ANDROID
bool ContentRendererClient::HandleNavigation(
RenderFrame* render_frame,
DocumentState* document_state,
@@ -104,7 +103,6 @@
bool is_redirect) {
return false;
}
-#endif
bool ContentRendererClient::ShouldFork(blink::WebFrame* frame,
const GURL& url,
Index: public/renderer/content_renderer_client.h
===================================================================
--- public/renderer/content_renderer_client.h (revision 262261)
+++ public/renderer/content_renderer_client.h (working copy)
@@ -175,7 +175,6 @@
// Returns true if a popup window should be allowed.
virtual bool AllowPopup();
-#ifdef OS_ANDROID
// 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
@@ -190,7 +189,6 @@
blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy,
bool is_redirect);
-#endif
// 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 262261)
+++ renderer/render_frame_impl.cc (working copy)
@@ -2662,7 +2662,6 @@
WebNavigationType type,
WebNavigationPolicy default_policy,
bool is_redirect) {
-#ifdef OS_ANDROID
// The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved.
if (request.url() != GURL(kSwappedOutURL) &&
@@ -2677,7 +2676,6 @@
is_redirect)) {
return blink::WebNavigationPolicyIgnore;
}
-#endif
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(frame, request));

View File

@@ -0,0 +1,17 @@
Index: resource_ids
===================================================================
--- resource_ids (revision 149431)
+++ resource_ids (working copy)
@@ -16,6 +16,12 @@
{
"SRCDIR": "../..",
+ "cef/libcef/resources/cef_resources.grd": {
+ "includes": [27500],
+ },
+ "cef/libcef/resources/cef_strings.grd": {
+ "messages": [28000],
+ },
"chrome/browser/browser_resources.grd": {
"includes": [500],
"structures": [750],

View File

@@ -0,0 +1,22 @@
Index: gyp/generator/ninja.py
===================================================================
--- gyp/generator/ninja.py (revision 1880)
+++ gyp/generator/ninja.py (working copy)
@@ -738,7 +738,16 @@
for path in copy['files']:
# Normalize the path so trailing slashes don't confuse us.
path = os.path.normpath(path)
- basename = os.path.split(path)[1]
+ (parent_path, basename) = os.path.split(path)
+
+ # Xcode uses .lproj directories for localized resources. Add a special
+ # case to maintain the localization directory component if present.
+ if parent_path != '':
+ parent_basename = os.path.basename(parent_path)
+ (parent_root, parent_ext) = os.path.splitext(parent_basename)
+ if parent_ext == '.lproj':
+ basename = os.path.join(parent_basename, basename)
+
src = self.GypPathToNinja(path, env)
dst = self.GypPathToNinja(os.path.join(copy['destination'], basename),
env)

View File

@@ -0,0 +1,13 @@
Index: message_loop.cc
===================================================================
--- message_loop.cc (revision 261035)
+++ message_loop.cc (working copy)
@@ -144,7 +144,7 @@
MessageLoop::~MessageLoop() {
DCHECK_EQ(this, current());
- DCHECK(!run_loop_);
+ //DCHECK(!run_loop_);
// Clean up any unprocessed tasks, but take care: deleting a task could
// result in the addition of more tasks (e.g., via DeleteSoon). We set a

View File

@@ -0,0 +1,25 @@
Index: public/common/common_param_traits_macros.h
===================================================================
--- public/common/common_param_traits_macros.h (revision 261035)
+++ public/common/common_param_traits_macros.h (working copy)
@@ -182,6 +182,7 @@
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 261035)
+++ renderer/web_preferences.cc (working copy)
@@ -163,6 +163,8 @@
settings->setCookieEnabled(prefs.cookie_enabled);
settings->setNavigateOnDragDrop(prefs.navigate_on_drag_drop);
+ web_view->setBaseBackgroundColor(prefs.base_background_color);
+
// This setting affects the behavior of links in an editable region:
// clicking the link should select it rather than navigate to it.
// Safari uses the same default. It is unlikley an embedder would want to

View File

@@ -0,0 +1,24 @@
Index: common/webpreferences.cc
===================================================================
--- common/webpreferences.cc (revision 261035)
+++ common/webpreferences.cc (working copy)
@@ -121,6 +121,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 261035)
+++ common/webpreferences.h (working copy)
@@ -156,6 +156,7 @@
bool use_solid_color_scrollbars;
bool compositor_touch_hit_testing;
bool navigate_on_drag_drop;
+ int 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,162 @@
Index: compositing_iosurface_layer_mac.mm
===================================================================
--- compositing_iosurface_layer_mac.mm (revision 262261)
+++ compositing_iosurface_layer_mac.mm (working copy)
@@ -120,7 +120,7 @@
(context_ && context_->cgl_context() != glContext) ||
!renderWidgetHostView_ ||
!renderWidgetHostView_->compositing_iosurface_) {
- glClearColor(1, 1, 1, 1);
+ glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
return;
}
Index: compositing_iosurface_mac.mm
===================================================================
--- compositing_iosurface_mac.mm (revision 262261)
+++ compositing_iosurface_mac.mm (working copy)
@@ -362,7 +362,7 @@
glUseProgram(0); CHECK_AND_SAVE_GL_ERROR();
} else {
// Should match the clear color of RenderWidgetHostViewMac.
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
}
Index: compositing_iosurface_shader_programs_mac.cc
===================================================================
--- compositing_iosurface_shader_programs_mac.cc (revision 262261)
+++ compositing_iosurface_shader_programs_mac.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/stringprintf.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 +52,7 @@
}
);
+float bgcolor[] = {1.0f, 1.0f, 1.0f};
// Only calculates position.
const char kvsSolidWhite[] = GLSL_PROGRAM_AS_STRING(
@@ -238,6 +240,16 @@
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(%f, %f, %f, 1.0); }",
+ bgcolor[0], bgcolor[1], bgcolor[2]);
+ 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 +424,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 262261)
+++ 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 262261)
+++ render_widget_host_view_aura.cc (working copy)
@@ -2680,7 +2680,7 @@
// canvas coming from the compositor to already be initialized as
// transparent.
if (window_->layer()->fills_bounds_opaquely())
- canvas->DrawColor(SK_ColorWHITE);
+ canvas->DrawColor(SK_ColorTRANSPARENT);
}
}
Index: render_widget_host_view_mac.mm
===================================================================
--- render_widget_host_view_mac.mm (revision 262261)
+++ render_widget_host_view_mac.mm (working copy)
@@ -433,7 +433,7 @@
use_core_animation_ = true;
background_layer_.reset([[CALayer alloc] init]);
[background_layer_
- setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+ setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
[cocoa_view_ setLayer:background_layer_];
[cocoa_view_ setWantsLayer:YES];
}
@@ -3065,7 +3065,7 @@
NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)];
CGContextSetFillColorWithColor(context,
- CGColorGetConstantColor(kCGColorWhite));
+ CGColorGetConstantColor(kCGColorClear));
CGContextFillRect(context, NSRectToCGRect(r));
}
if (damagedRect.bottom() > rect.bottom()) {
@@ -3087,7 +3087,7 @@
NSRect r = [self flipRectToNSRect:gfx::Rect(x, y, width, height)];
CGContextSetFillColorWithColor(context,
- CGColorGetConstantColor(kCGColorWhite));
+ CGColorGetConstantColor(kCGColorClear));
CGContextFillRect(context, NSRectToCGRect(r));
}
}
@@ -3237,7 +3237,7 @@
}
} else {
CGContextSetFillColorWithColor(context,
- CGColorGetConstantColor(kCGColorWhite));
+ CGColorGetConstantColor(kCGColorClear));
CGContextFillRect(context, dirtyRect);
if (renderWidgetHostView_->whiteout_start_time_.is_null())
renderWidgetHostView_->whiteout_start_time_ = base::TimeTicks::Now();
@@ -4260,7 +4260,7 @@
if (self = [super init]) {
renderWidgetHostView_ = r;
- [self setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
+ [self setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
[self setAnchorPoint:CGPointMake(0, 0)];
// Setting contents gravity is necessary to prevent the layer from being
// scaled during dyanmic resizes (especially with devtools open).
@@ -4289,7 +4289,7 @@
inContext:context];
} else {
CGContextSetFillColorWithColor(context,
- CGColorGetConstantColor(kCGColorWhite));
+ CGColorGetConstantColor(kCGColorClear));
CGContextFillRect(context, clipRect);
}
}

View File

@@ -0,0 +1,34 @@
Index: core/frame/FrameView.cpp
===================================================================
--- core/frame/FrameView.cpp (revision 170525)
+++ core/frame/FrameView.cpp (working copy)
@@ -165,8 +165,10 @@
if (!isMainFrame())
return;
+#if 0
ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
+#endif
}
PassRefPtr<FrameView> FrameView::create(LocalFrame* frame)
Index: platform/scroll/ScrollbarThemeMacCommon.mm
===================================================================
--- platform/scroll/ScrollbarThemeMacCommon.mm (revision 170525)
+++ platform/scroll/ScrollbarThemeMacCommon.mm (working copy)
@@ -358,10 +358,14 @@
// static
bool ScrollbarThemeMacCommon::isOverlayAPIAvailable()
{
+#if 0
static bool apiAvailable =
[NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)]
&& [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)];
return apiAvailable;
+#else
+ return false;
+#endif
}
} // namespace WebCore

View File

@@ -0,0 +1,13 @@
Index: underlay_opengl_hosting_window.h
===================================================================
--- underlay_opengl_hosting_window.h (revision 248478)
+++ underlay_opengl_hosting_window.h (working copy)
@@ -12,7 +12,7 @@
// Common base class for windows that host a OpenGL surface that renders under
// the window. Contains methods relating to hole punching so that the OpenGL
// surface is visible through the window.
-UI_BASE_EXPORT
+__attribute__((visibility("default")))
@interface UnderlayOpenGLHostingWindow : NSWindow
@end

View File

@@ -0,0 +1,65 @@
Index: web_dialog_view.cc
===================================================================
--- web_dialog_view.cc (revision 261035)
+++ web_dialog_view.cc (working copy)
@@ -257,13 +257,6 @@
return true;
}
-bool WebDialogView::HandleContextMenu(
- const content::ContextMenuParams& params) {
- if (delegate_)
- return delegate_->HandleContextMenu(params);
- return WebDialogWebContentsDelegate::HandleContextMenu(params);
-}
-
////////////////////////////////////////////////////////////////////////////////
// content::WebContentsDelegate implementation:
@@ -337,6 +330,15 @@
*proceed_to_fire_unload = proceed;
}
+bool WebDialogView::HandleContextMenu(
+ content::RenderFrameHost* render_frame_host,
+ const content::ContextMenuParams& params) {
+ if (delegate_)
+ return delegate_->HandleContextMenu(params);
+ return WebDialogWebContentsDelegate::HandleContextMenu(render_frame_host,
+ params);
+}
+
////////////////////////////////////////////////////////////////////////////////
// WebDialogView, private:
Index: web_dialog_view.h
===================================================================
--- web_dialog_view.h (revision 261035)
+++ web_dialog_view.h (working copy)
@@ -74,6 +74,7 @@
virtual const views::Widget* GetWidget() const OVERRIDE;
// Overridden from ui::WebDialogDelegate:
+ using ui::WebDialogDelegate::HandleContextMenu;
virtual ui::ModalType GetDialogModalType() const OVERRIDE;
virtual base::string16 GetDialogTitle() const OVERRIDE;
virtual GURL GetDialogContentURL() const OVERRIDE;
@@ -91,8 +92,6 @@
virtual void OnCloseContents(content::WebContents* source,
bool* out_close_dialog) OVERRIDE;
virtual bool ShouldShowDialogTitle() const OVERRIDE;
- virtual bool HandleContextMenu(
- const content::ContextMenuParams& params) OVERRIDE;
// Overridden from content::WebContentsDelegate:
virtual void MoveContents(content::WebContents* source,
@@ -115,6 +114,9 @@
virtual void BeforeUnloadFired(content::WebContents* tab,
bool proceed,
bool* proceed_to_fire_unload) OVERRIDE;
+ virtual bool HandleContextMenu(
+ content::RenderFrameHost* render_frame_host,
+ const content::ContextMenuParams& params) OVERRIDE;
private:
FRIEND_TEST_ALL_PREFIXES(WebDialogBrowserTest, WebContentRendered);

View File

@@ -0,0 +1,86 @@
Index: desktop_aura/desktop_screen_win.cc
===================================================================
--- desktop_aura/desktop_screen_win.cc (revision 261035)
+++ desktop_aura/desktop_screen_win.cc (working copy)
@@ -54,6 +54,8 @@
}
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
+ if (!window)
+ return NULL;
aura::WindowTreeHost* host = window->GetHost();
return host ? host->GetAcceleratedWidget() : NULL;
}
Index: desktop_aura/desktop_window_tree_host_win.cc
===================================================================
--- desktop_aura/desktop_window_tree_host_win.cc (revision 261035)
+++ desktop_aura/desktop_window_tree_host_win.cc (working copy)
@@ -130,7 +130,9 @@
native_widget_delegate_);
HWND parent_hwnd = NULL;
- if (params.parent && params.parent->GetHost())
+ if (params.parent_widget)
+ parent_hwnd = params.parent_widget;
+ else if (params.parent && params.parent->GetHost())
parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
message_handler_->set_remove_standard_frame(params.remove_standard_frame);
Index: desktop_aura/desktop_window_tree_host_win.h
===================================================================
--- desktop_aura/desktop_window_tree_host_win.h (revision 261035)
+++ desktop_aura/desktop_window_tree_host_win.h (working copy)
@@ -214,6 +214,7 @@
LPARAM l_param) OVERRIDE;
virtual bool HandleScrollEvent(const ui::ScrollEvent& event) OVERRIDE;
+ public:
Widget* GetWidget();
const Widget* GetWidget() const;
HWND GetHWND() const;
Index: widget.cc
===================================================================
--- widget.cc (revision 261035)
+++ widget.cc (working copy)
@@ -122,6 +122,7 @@
show_state(ui::SHOW_STATE_DEFAULT),
double_buffer(false),
parent(NULL),
+ parent_widget(NULL),
native_widget(NULL),
desktop_window_tree_host(NULL),
top_level(false),
@@ -148,6 +149,7 @@
show_state(ui::SHOW_STATE_DEFAULT),
double_buffer(false),
parent(NULL),
+ parent_widget(NULL),
native_widget(NULL),
desktop_window_tree_host(NULL),
top_level(false),
@@ -386,7 +388,12 @@
Minimize();
} else if (params.delegate) {
SetContentsView(params.delegate->GetContentsView());
- SetInitialBoundsForFramelessWindow(params.bounds);
+ if (params.parent_widget) {
+ // Set the bounds directly instead of applying an inset.
+ SetBounds(params.bounds);
+ } else {
+ SetInitialBoundsForFramelessWindow(params.bounds);
+ }
}
native_widget_initialized_ = true;
}
Index: widget.h
===================================================================
--- widget.h (revision 261035)
+++ widget.h (working copy)
@@ -200,6 +200,7 @@
// Should the widget be double buffered? Default is false.
bool double_buffer;
gfx::NativeView parent;
+ gfx::AcceleratedWidget parent_widget;
// Specifies the initial bounds of the Widget. Default is empty, which means
// the NativeWidget may specify a default size. If the parent is specified,
// |bounds| is in the parent's coordinate system. If the parent is not

View File

@@ -0,0 +1,92 @@
Index: browser/browser_plugin/browser_plugin_guest.cc
===================================================================
--- browser/browser_plugin/browser_plugin_guest.cc (revision 262261)
+++ browser/browser_plugin/browser_plugin_guest.cc (working copy)
@@ -794,7 +794,8 @@
return this;
}
-bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) {
+bool BrowserPluginGuest::HandleContextMenu(RenderFrameHost* render_frame_host,
+ const ContextMenuParams& params) {
// TODO(fsamuel): We show the regular page context menu handler for now until
// we implement the Apps Context Menu API for Browser Plugin (see
// http://crbug.com/140315).
Index: browser/browser_plugin/browser_plugin_guest.h
===================================================================
--- browser/browser_plugin/browser_plugin_guest.h (revision 262261)
+++ browser/browser_plugin/browser_plugin_guest.h (working copy)
@@ -204,7 +204,8 @@
double progress) OVERRIDE;
virtual void CloseContents(WebContents* source) OVERRIDE;
virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
- virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE;
+ virtual bool HandleContextMenu(RenderFrameHost* render_frame_host,
+ const ContextMenuParams& params) OVERRIDE;
virtual void HandleKeyboardEvent(
WebContents* source,
const NativeWebKeyboardEvent& event) OVERRIDE;
Index: browser/web_contents/web_contents_impl.cc
===================================================================
--- browser/web_contents/web_contents_impl.cc (revision 262261)
+++ browser/web_contents/web_contents_impl.cc (working copy)
@@ -2788,7 +2788,7 @@
void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host,
const ContextMenuParams& params) {
// Allow WebContentsDelegates to handle the context menu operation first.
- if (delegate_ && delegate_->HandleContextMenu(params))
+ if (delegate_ && delegate_->HandleContextMenu(render_frame_host, params))
return;
render_view_host_delegate_view_->ShowContextMenu(render_frame_host, params);
Index: browser/web_contents/web_contents_view_mac.mm
===================================================================
--- browser/web_contents/web_contents_view_mac.mm (revision 262261)
+++ browser/web_contents/web_contents_view_mac.mm (working copy)
@@ -227,12 +227,6 @@
void WebContentsViewMac::ShowContextMenu(
content::RenderFrameHost* render_frame_host,
const ContextMenuParams& params) {
- // Allow delegates to handle the context menu operation first.
- if (web_contents_->GetDelegate() &&
- web_contents_->GetDelegate()->HandleContextMenu(params)) {
- return;
- }
-
if (delegate())
delegate()->ShowContextMenu(render_frame_host, params);
else
Index: public/browser/web_contents_delegate.cc
===================================================================
--- public/browser/web_contents_delegate.cc (revision 262261)
+++ public/browser/web_contents_delegate.cc (working copy)
@@ -76,6 +76,7 @@
}
bool WebContentsDelegate::HandleContextMenu(
+ RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) {
return false;
}
Index: public/browser/web_contents_delegate.h
===================================================================
--- public/browser/web_contents_delegate.h (revision 262261)
+++ public/browser/web_contents_delegate.h (working copy)
@@ -35,6 +35,7 @@
class DownloadItem;
class JavaScriptDialogManager;
class PageState;
+class RenderFrameHost;
class RenderViewHost;
class SessionStorageNamespace;
class WebContents;
@@ -231,7 +232,8 @@
virtual int GetExtraRenderViewHeight() const;
// Returns true if the context menu operation was handled by the delegate.
- virtual bool HandleContextMenu(const content::ContextMenuParams& params);
+ virtual bool HandleContextMenu(RenderFrameHost* render_frame_host,
+ const content::ContextMenuParams& params);
// Opens source view for given WebContents that is navigated to the given
// page url.

View File

@@ -0,0 +1,13 @@
Index: WebNode.cpp
===================================================================
--- WebNode.cpp (revision 170525)
+++ WebNode.cpp (working copy)
@@ -172,7 +172,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

View File

@@ -0,0 +1,76 @@
Index: public/web/WebView.h
===================================================================
--- public/web/WebView.h (revision 171002)
+++ public/web/WebView.h (working copy)
@@ -417,6 +417,7 @@
// Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool);
+ virtual void setUseExternalPopupMenusThisInstance(bool) = 0;
// Hides any popup (suggestions, selects...) that might be showing.
virtual void hidePopups() = 0;
Index: Source/web/ChromeClientImpl.cpp
===================================================================
--- Source/web/ChromeClientImpl.cpp (revision 171002)
+++ Source/web/ChromeClientImpl.cpp (working copy)
@@ -755,7 +755,7 @@
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(LocalFrame& frame, PopupMenuClient* client) const
{
- if (WebViewImpl::useExternalPopupMenus())
+ if (m_webView->useExternalPopupMenus())
return adoptRef(new ExternalPopupMenu(frame, client, *m_webView));
return adoptRef(new PopupMenuChromium(frame, client));
Index: Source/web/WebViewImpl.cpp
===================================================================
--- Source/web/WebViewImpl.cpp (revision 171002)
+++ Source/web/WebViewImpl.cpp (working copy)
@@ -338,6 +338,7 @@
, m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false)
, m_contextMenuAllowed(false)
+ , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0)
@@ -3472,9 +3473,14 @@
updateLayerTreeViewport();
}
+void WebViewImpl::setUseExternalPopupMenusThisInstance(bool useExternalPopupMenus)
+{
+ m_shouldUseExternalPopupMenus = useExternalPopupMenus;
+}
+
bool WebViewImpl::useExternalPopupMenus()
{
- return shouldUseExternalPopupMenus;
+ return m_shouldUseExternalPopupMenus;
}
void WebViewImpl::startDragging(LocalFrame* frame,
Index: Source/web/WebViewImpl.h
===================================================================
--- Source/web/WebViewImpl.h (revision 171002)
+++ Source/web/WebViewImpl.h (working copy)
@@ -391,7 +391,8 @@
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
- static bool useExternalPopupMenus();
+ void setUseExternalPopupMenusThisInstance(bool);
+ bool useExternalPopupMenus();
bool contextMenuAllowed() const
{
@@ -669,6 +670,8 @@
bool m_contextMenuAllowed;
+ bool m_shouldUseExternalPopupMenus;
+
bool m_doingDragAndDrop;
bool m_ignoreInputEvents;

13
patch/patches/zlib.patch Normal file
View File

@@ -0,0 +1,13 @@
Index: contrib/minizip/unzip.c
===================================================================
--- contrib/minizip/unzip.c (revision 176706)
+++ contrib/minizip/unzip.c (working copy)
@@ -69,7 +69,7 @@
#include <string.h>
#ifndef NOUNCRYPT
- #define NOUNCRYPT
+// #define NOUNCRYPT
#endif
#include "third_party/zlib/zlib.h"