Commit cc3419c1 authored by noms@chromium.org's avatar noms@chromium.org

[Mac] User manager should open on the screen that has focus

(vs always opening on the first screen like it's happening now)

BUG=405602
TEST=Start Chrome with --enable-new-avatar-menu (if it's not own by default). If you've got to screens, when you press "Switch users" the User Manager should show up on whatever screen you triggered it from.

Review URL: https://codereview.chromium.org/489953002

Cr-Commit-Position: refs/heads/master@{#291201}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291201 0039d316-1c4b-4281-b951-d872f2087c98
parent 51520baa
...@@ -92,11 +92,10 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate { ...@@ -92,11 +92,10 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
- (id)initWithProfile:(Profile*)profile - (id)initWithProfile:(Profile*)profile
withObserver:(UserManagerMac*)userManagerObserver { withObserver:(UserManagerMac*)userManagerObserver {
// Center the window on the primary screen. // Center the window on the screen that currently has focus.
CGFloat screenHeight = NSScreen* mainScreen = [NSScreen mainScreen];
[[[NSScreen screens] objectAtIndex:0] frame].size.height; CGFloat screenHeight = [mainScreen frame].size.height;
CGFloat screenWidth = CGFloat screenWidth = [mainScreen frame].size.width;
[[[NSScreen screens] objectAtIndex:0] frame].size.width;
NSRect contentRect = NSMakeRect((screenWidth - kWindowWidth) / 2, NSRect contentRect = NSMakeRect((screenWidth - kWindowWidth) / 2,
(screenHeight - kWindowHeight) / 2, (screenHeight - kWindowHeight) / 2,
...@@ -107,7 +106,8 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate { ...@@ -107,7 +106,8 @@ class UserManagerWebContentsDelegate : public content::WebContentsDelegate {
NSClosableWindowMask | NSClosableWindowMask |
NSResizableWindowMask NSResizableWindowMask
backing:NSBackingStoreBuffered backing:NSBackingStoreBuffered
defer:NO]; defer:NO
screen:mainScreen];
[window setTitle:l10n_util::GetNSString(IDS_PRODUCT_NAME)]; [window setTitle:l10n_util::GetNSString(IDS_PRODUCT_NAME)];
[window setMinSize:NSMakeSize(kWindowWidth, kWindowHeight)]; [window setMinSize:NSMakeSize(kWindowWidth, kWindowHeight)];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment