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

Side by Side Diff: chrome/browser/profiles/profiles_state.cc

Issue 33753002: Sooper experimental refactoring of the profile info cache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profiles_state.h" 5 #include "chrome/browser/profiles/profiles_state.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 string16 GetActiveProfileDisplayName(Browser* browser) { 63 string16 GetActiveProfileDisplayName(Browser* browser) {
64 string16 profile_name; 64 string16 profile_name;
65 Profile* profile = browser->profile(); 65 Profile* profile = browser->profile();
66 66
67 if (profile->IsGuestSession()) { 67 if (profile->IsGuestSession()) {
68 profile_name = l10n_util::GetStringUTF16(IDS_GUEST_PROFILE_NAME); 68 profile_name = l10n_util::GetStringUTF16(IDS_GUEST_PROFILE_NAME);
69 } else { 69 } else {
70 ProfileInfoCache& cache = 70 ProfileInfoCache& cache =
71 g_browser_process->profile_manager()->GetProfileInfoCache(); 71 g_browser_process->profile_manager()->GetProfileInfoCache();
72 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); 72
73 if (index != std::string::npos) 73 ProfileInfoEntry entry;
74 profile_name = cache.GetNameOfProfileAtIndex(index); 74 if (cache.GetInfoForProfile(profile->GetPath(), &entry))
75 profile_name = entry.GetDisplayName();
75 } 76 }
76 return profile_name; 77 return profile_name;
77 } 78 }
78 79
79 } // namespace profiles 80 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_win.cc ('k') | chrome/browser/signin/signin_names_io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698