Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
| index 498f427ff7ca71f88a2d8469161e92bcbe342fc9..7140e3860eadef2b1970d38e31dc611c549d7d1a 100644 |
| --- a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm |
| @@ -15,6 +15,7 @@ |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/profiles/profile_window.h" |
| #include "chrome/browser/ui/browser.h" |
| +#include "chrome/browser/ui/browser_dialogs.h" |
| #include "chrome/browser/ui/browser_window.h" |
| #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| @@ -98,9 +99,14 @@ void SetWindowSize(NSWindow* window, NSSize size) { |
| } |
| - (IBAction)showUserManager:(id)sender { |
| - // TODO(noms): This should use chrome::ShowUserManager() when the |
| - // implementation is ready. |
| - chrome::ShowSingletonTab(browser_, GURL(chrome::kChromeUIUserManagerURL)); |
| + // Only non-guest users appear in the User Manager. |
| + base::FilePath profile_path; |
| + // The button tag indicates whether the active profile is a non-guest profile. |
| + if ([sender tag]) { |
| + size_t active_index = avatarMenu_->GetActiveProfileIndex(); |
| + profile_path = avatarMenu_->GetItemAt(active_index).profile_path; |
| + } |
| + chrome::ShowUserManager(profile_path); |
|
groby-ooo-7-16
2013/12/04 01:59:48
Is ShowUserManager OK with an empty path? Should i
noms (inactive)
2013/12/05 17:55:06
Yes. If the path is non empty, the User Manager fo
|
| } |
| - (IBAction)switchToGuestProfile:(id)sender { |
| @@ -142,6 +148,9 @@ void SetWindowSize(NSWindow* window, NSSize size) { |
| NSView* currentProfileView = nil; |
| base::scoped_nsobject<NSMutableArray> otherProfiles( |
| [[NSMutableArray alloc] init]); |
| + |
| + // By default, assume the active profile is a guest, and change this |
| + // if an active profile is discovered. |
| BOOL isGuestView = YES; |
| for (size_t i = 0; i < avatarMenu_->GetNumberOfItems(); ++i) { |
| @@ -263,6 +272,7 @@ void SetWindowSize(NSWindow* window, NSSize size) { |
| withTextResourceId:IDS_PROFILES_ALL_PEOPLE_BUTTON |
| withResourceId:IDR_ICON_PROFILES_ADD_USER]; |
| [allUsersButton setTarget:self]; |
| + [allUsersButton setTag:!isGuestView]; |
| [allUsersButton setAction:@selector(showUserManager:)]; |
| yOffset = NSMaxY([allUsersButton frame]) + kSmallVerticalSpacing; |