Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6074)

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 157843003: linux_aura: Put toolbar dropdown menus on the screen with the cursor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index a7cf0c7c2e6a8afc1633ae37b5612a866e574957..2e0e6a4458d744d2d8e03ca1bf2870a16e54b145 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -177,8 +177,13 @@ void ToolbarButton::ShowDropDownMenu(ui::MenuSourceType source_type) {
view)->GetDisplayNearestWindow(view);
int left_bound = display.bounds().x();
#else
- int left_bound = 0;
- NOTIMPLEMENTED();
+ // The window might be positioned over the edge between two screens. We'll
+ // want to position the dropdown on the screen the mouse cursor is on.
+ gfx::NativeView view = GetWidget()->GetNativeView();
+ gfx::Screen* screen = gfx::Screen::GetScreenFor(view);
+ gfx::Display display = screen->GetDisplayNearestPoint(
+ screen->GetCursorScreenPoint());
+ int left_bound = display.bounds().x();
#endif
if (menu_position.x() < left_bound)
menu_position.set_x(left_bound);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698