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

Unified Diff: chrome/browser/automation/automation_provider_mac.mm

Issue 751002: Fix Mac window frame coordinate conversion on multiple monitor setups (Closed)
Patch Set: Fix another instance Created 10 years, 9 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 | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/automation_provider_mac.mm
diff --git a/chrome/browser/automation/automation_provider_mac.mm b/chrome/browser/automation/automation_provider_mac.mm
index b475f4d4e02d536bcfc53be54c506cd1525235bc..e17d59c9b9b2c013d4483a963ab10cb3de9b4e54 100644
--- a/chrome/browser/automation/automation_provider_mac.mm
+++ b/chrome/browser/automation/automation_provider_mac.mm
@@ -22,10 +22,11 @@ void AutomationProvider::SetWindowBounds(int handle, const gfx::Rect& bounds,
if (window) {
NSRect new_bounds = NSRectFromCGRect(bounds.ToCGRect());
- // This is likely incorrect for a multiple-monitor setup; OK because this
- // is used only for testing purposes.
- new_bounds.origin.y = [[window screen] frame].size.height -
- new_bounds.origin.y - new_bounds.size.height;
+ if ([[NSScreen screens] count] > 0) {
+ new_bounds.origin.y =
+ [[[NSScreen screens] objectAtIndex:0] frame].size.height -
+ new_bounds.origin.y - new_bounds.size.height;
+ }
[window setFrame:new_bounds display:NO];
*success = true;
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698