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

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
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 fd54aa51519f0121167f73516882dfdfce8b0618..5bd20bf8cccb70e8e8902a7c117e89cd1d0c9c2b 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];

Powered by Google App Engine
This is Rietveld 408576698