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

Unified Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm

Issue 489953002: [Mac] User manager should open on the screen that has focus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/profiles/user_manager_mac.mm
diff --git a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
index 7d2219da3f5153a7d6d124adb002e06fe22800a0..7885504f1f6564f7fef829e7fa301d4a9d806a6e 100644
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac.mm
@@ -92,11 +92,10 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
- (id)initWithProfile:(Profile*)profile
withObserver:(UserManagerMac*)userManagerObserver {
- // Center the window on the primary screen.
- CGFloat screenHeight =
- [[[NSScreen screens] objectAtIndex:0] frame].size.height;
- CGFloat screenWidth =
- [[[NSScreen screens] objectAtIndex:0] frame].size.width;
+ // Center the window on the screen that currently has focus.
+ NSScreen* mainScreen = [NSScreen mainScreen];
+ CGFloat screenHeight = [mainScreen frame].size.height;
+ CGFloat screenWidth = [mainScreen frame].size.width;
NSRect contentRect = NSMakeRect((screenWidth - kWindowWidth) / 2,
(screenHeight - kWindowHeight) / 2,
@@ -107,7 +106,8 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
NSClosableWindowMask |
NSResizableWindowMask
backing:NSBackingStoreBuffered
- defer:NO];
+ defer:NO
+ screen:mainScreen];
[window setTitle:l10n_util::GetNSString(IDS_PRODUCT_NAME)];
[window setMinSize:NSMakeSize(kWindowWidth, kWindowHeight)];
« 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