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

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

Issue 8230011: [Mac/multiprofile] "Customize User..." should edit the currently active profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments Created 9 years, 2 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 | « chrome/browser/profiles/avatar_menu_model_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profile_menu_controller.mm
diff --git a/chrome/browser/ui/cocoa/profile_menu_controller.mm b/chrome/browser/ui/cocoa/profile_menu_controller.mm
index ad4ff7a673bcd909062a98ff98a6d4e44b13c6ea..b1ff2fcbd7c5eb4cb3abea9b8378c6dab9379efd 100644
--- a/chrome/browser/ui/cocoa/profile_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/profile_menu_controller.mm
@@ -84,7 +84,7 @@ class Observer : public BrowserList::Observer,
}
- (IBAction)editProfile:(id)sender {
- model_->EditProfile([sender tag]);
+ model_->EditProfile(model_->GetActiveProfileIndex());
}
- (IBAction)newProfile:(id)sender {
@@ -127,22 +127,14 @@ class Observer : public BrowserList::Observer,
// Tell the model that the browser has changed.
model_->set_browser(browser);
- // Then find the profile to mark as active.
- Profile* profile = NULL;
- if (!browser)
- profile = ProfileManager::GetLastUsedProfile();
- else
- profile = browser->profile();
-
- ProfileInfoInterface& info =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index = info.GetIndexOfProfileWithPath(profile->GetPath());
+ size_t active_profile_index = model_->GetActiveProfileIndex();
// Update the state for the menu items.
for (size_t i = 0; i < model_->GetNumberOfItems(); ++i) {
size_t tag = model_->GetItemAt(i).model_index;
- [[[self menu] itemWithTag:tag] setState:index == tag ? NSOnState
- : NSOffState];
+ [[[self menu] itemWithTag:tag]
+ setState:active_profile_index == tag ? NSOnState
+ : NSOffState];
}
}
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698