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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm

Issue 17733005: [Autofill] (Mostly) fix Autofill popup positioning on multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Expand comment and use NSMaxY instead of NSHeight Created 7 years, 6 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/cocoa/autofill/autofill_popup_view_bridge.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm
index 18a41964d60739e434a33e324d34d5d91949c12a..494119d8eebd108bc53e2ff0e3836d846b35b086 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm
@@ -92,11 +92,12 @@ void AutofillPopupViewBridge::InvalidateRow(size_t row) {
void AutofillPopupViewBridge::UpdateBoundsAndRedrawPopup() {
NSRect frame = NSRectFromCGRect(controller_->popup_bounds().ToCGRect());
- // Flip coordinates back into Cocoa-land.
- // TODO(isherman): Does this agree with the controller's idea of handling
- // multi-monitor setups correctly?
- NSScreen* screen = [[controller_->container_view() window] screen];
- frame.origin.y = NSHeight([screen frame]) - NSMaxY(frame);
+ // Flip coordinates back into Cocoa-land. The controller's platform-neutral
+ // coordinate space places the origin at the top-left of the first screen,
+ // whereas Cocoa's coordinate space expects the origin to be at the
+ // bottom-left of this same screen.
+ NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
+ frame.origin.y = NSMaxY([screen frame]) - NSMaxY(frame);
// Leave room for the border.
frame = NSInsetRect(frame, -kBorderWidth, -kBorderWidth);
« 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