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

Unified Diff: chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm

Issue 102913002: [Mac] User manager should show up as a standalone window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rachel comments Created 7 years 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
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 386db324f2a4d0f8e46036bdcfbc1c26d67d6365..7ebf8c529eda41b2b23eca15cd5d46782e788f94 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"
@@ -103,9 +104,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);
}
- (IBAction)switchToGuestProfile:(id)sender {
@@ -147,6 +153,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) {
@@ -286,6 +295,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;

Powered by Google App Engine
This is Rietveld 408576698