Commit 98804919 authored by arjanl's avatar arjanl Committed by Commit bot

Set whether context menu appears on mouse up from WebPreferences

Whether the context menu appears on mouse up can depend on run-time
settings (in the case of Opera). This reads the setting to
WebPreferences, so that the browser has the possibility of
communicating the appropriate setting to the renderer. If not
explicitly set, it defaults, as before, to 'true' on Windows and
'false' on other platforms.

BUG=

Review URL: https://codereview.chromium.org/819293002

Cr-Commit-Position: refs/heads/master@{#319040}
parent e8c5cdc0
...@@ -113,6 +113,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) ...@@ -113,6 +113,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(minimum_font_size) IPC_STRUCT_TRAITS_MEMBER(minimum_font_size)
IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size) IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size)
IPC_STRUCT_TRAITS_MEMBER(default_encoding) IPC_STRUCT_TRAITS_MEMBER(default_encoding)
IPC_STRUCT_TRAITS_MEMBER(context_menu_on_mouse_up)
IPC_STRUCT_TRAITS_MEMBER(javascript_enabled) IPC_STRUCT_TRAITS_MEMBER(javascript_enabled)
IPC_STRUCT_TRAITS_MEMBER(web_security_enabled) IPC_STRUCT_TRAITS_MEMBER(web_security_enabled)
IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically) IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically)
......
...@@ -86,6 +86,11 @@ WebPreferences::WebPreferences() ...@@ -86,6 +86,11 @@ WebPreferences::WebPreferences()
minimum_font_size(0), minimum_font_size(0),
minimum_logical_font_size(6), minimum_logical_font_size(6),
default_encoding("ISO-8859-1"), default_encoding("ISO-8859-1"),
#if defined(OS_WIN)
context_menu_on_mouse_up(true),
#else
context_menu_on_mouse_up(false),
#endif
javascript_enabled(true), javascript_enabled(true),
web_security_enabled(true), web_security_enabled(true),
javascript_can_open_windows_automatically(true), javascript_can_open_windows_automatically(true),
......
...@@ -83,6 +83,7 @@ struct CONTENT_EXPORT WebPreferences { ...@@ -83,6 +83,7 @@ struct CONTENT_EXPORT WebPreferences {
int minimum_font_size; int minimum_font_size;
int minimum_logical_font_size; int minimum_logical_font_size;
std::string default_encoding; std::string default_encoding;
bool context_menu_on_mouse_up;
bool javascript_enabled; bool javascript_enabled;
bool web_security_enabled; bool web_security_enabled;
bool javascript_can_open_windows_automatically; bool javascript_can_open_windows_automatically;
......
...@@ -1124,9 +1124,7 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, ...@@ -1124,9 +1124,7 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
prefs.rubber_banding_on_compositor_thread); prefs.rubber_banding_on_compositor_thread);
settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars); settings->setUseSolidColorScrollbars(prefs.use_solid_color_scrollbars);
#if defined(OS_WIN) settings->setShowContextMenuOnMouseUp(prefs.context_menu_on_mouse_up);
settings->setShowContextMenuOnMouseUp(true);
#endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
settings->setDoubleTapToZoomEnabled(true); settings->setDoubleTapToZoomEnabled(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment