diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 22:13:04 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 22:13:04 +0000 |
commit | b88ab037fc20ab5dfe0f35d71e78acc8499979a5 (patch) | |
tree | 7d0a9863885e4c70fe1a24f021a28da8a95a736b /chrome/browser/renderer_host | |
parent | 5e26d9d482761e38a15f8cb987294d979bc58576 (diff) | |
download | chromium_src-b88ab037fc20ab5dfe0f35d71e78acc8499979a5.zip chromium_src-b88ab037fc20ab5dfe0f35d71e78acc8499979a5.tar.gz chromium_src-b88ab037fc20ab5dfe0f35d71e78acc8499979a5.tar.bz2 |
Do right-alignment of popups when WebKit indicates to do so.
BUG=http://crbug.com/23106
TEST=as in bug
Review URL: http://codereview.chromium.org/1992006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
5 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index c53c7be..a0f3be7 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -917,7 +917,8 @@ void RenderWidgetHost::OnMsgShowPopup( params.item_height, params.item_font_size, params.selected_item, - params.popup_items); + params.popup_items, + params.right_aligned); } void RenderWidgetHost::OnMsgGetScreenInfo(gfx::NativeViewId view, diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index 3a285c1..6d3f6e7 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -168,7 +168,8 @@ class RenderWidgetHostView { int item_height, double item_font_size, int selected_item, - const std::vector<WebMenuItem>& items) = 0; + const std::vector<WebMenuItem>& items, + bool right_aligned) = 0; // Get the view's position on the screen. virtual gfx::Rect GetWindowRect() = 0; diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h index d79b0f1..07f65e2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.h +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h @@ -179,7 +179,8 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { int item_height, double item_font_size, int selected_item, - const std::vector<WebMenuItem>& items); + const std::vector<WebMenuItem>& items, + bool right_aligned); virtual gfx::Rect GetWindowRect(); virtual gfx::Rect GetRootWindowRect(); virtual void SetActive(bool active); diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index 104b346..ac130c9 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -464,7 +464,8 @@ void RenderWidgetHostViewMac::ShowPopupWithItems( int item_height, double item_font_size, int selected_item, - const std::vector<WebMenuItem>& items) { + const std::vector<WebMenuItem>& items, + bool right_aligned) { is_popup_menu_ = true; // Retain the Cocoa view for the duration of the pop-up so that it can't @@ -483,7 +484,8 @@ void RenderWidgetHostViewMac::ShowPopupWithItems( // Display the menu. scoped_nsobject<WebMenuRunner> menu_runner; menu_runner.reset([[WebMenuRunner alloc] initWithItems:items - fontSize:item_font_size]); + fontSize:item_font_size + rightAligned:right_aligned]); { // Make sure events can be pumped while the menu is up. @@ -1041,7 +1043,8 @@ bool RenderWidgetHostViewMac::ContainsNativeView( return; } - DCHECK(renderWidgetHostView_->render_widget_host_->process()->HasConnection()); + DCHECK( + renderWidgetHostView_->render_widget_host_->process()->HasConnection()); DCHECK(!renderWidgetHostView_->about_to_validate_and_paint_); renderWidgetHostView_->about_to_validate_and_paint_ = true; diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h index 2725bb3..725bacf 100644 --- a/chrome/browser/renderer_host/test/test_render_view_host.h +++ b/chrome/browser/renderer_host/test/test_render_view_host.h @@ -76,7 +76,8 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { int item_height, double item_font_size, int selected_item, - const std::vector<WebMenuItem>& items) {} + const std::vector<WebMenuItem>& items, + bool right_aligned) {} virtual gfx::Rect GetWindowRect(); virtual gfx::Rect GetRootWindowRect(); virtual void SetActive(bool active); |