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

Unified Diff: chrome/browser/profiles/avatar_menu_model.cc

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.h ('k') | chrome/browser/profiles/avatar_menu_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/avatar_menu_model.cc
diff --git a/chrome/browser/profiles/avatar_menu_model.cc b/chrome/browser/profiles/avatar_menu_model.cc
index e389eb6f6f7343082ac9a890cad5fee54aae98be..a41e764b0480b67d3812fc2e2133ca64084b8405 100644
--- a/chrome/browser/profiles/avatar_menu_model.cc
+++ b/chrome/browser/profiles/avatar_menu_model.cc
@@ -103,6 +103,20 @@ size_t AvatarMenuModel::GetNumberOfItems() {
return items_.size();
}
+size_t AvatarMenuModel::GetActiveProfileIndex() {
+ Profile* active_profile = NULL;
+ if (!browser_)
+ active_profile = ProfileManager::GetLastUsedProfile();
+ else
+ active_profile = browser_->profile();
+
+ size_t index =
+ profile_info_->GetIndexOfProfileWithPath(active_profile->GetPath());
+
+ DCHECK_LT(index, items_.size());
+ return index;
+}
+
const AvatarMenuModel::Item& AvatarMenuModel::GetItemAt(size_t index) {
DCHECK_LT(index, items_.size());
return *items_[index];
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model.h ('k') | chrome/browser/profiles/avatar_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698