| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |