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

Unified Diff: chrome/browser/ui/webui/app_launcher_login_handler.cc

Issue 1723643002: Refactor ProfileInfoCache in c/b/ui/webui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a signed/unsigned integer conversion, one removed #include Created 4 years, 10 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 | « no previous file | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/app_launcher_login_handler.cc
diff --git a/chrome/browser/ui/webui/app_launcher_login_handler.cc b/chrome/browser/ui/webui/app_launcher_login_handler.cc
index f99e987f33e912f1abc4e0a04b9ad4e6654a8e49..5d048926c0ff90879e91d747738fef587710bf8d 100644
--- a/chrome/browser/ui/webui/app_launcher_login_handler.cc
+++ b/chrome/browser/ui/webui/app_launcher_login_handler.cc
@@ -16,7 +16,8 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_attributes_entry.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/signin/signin_manager_factory.h"
@@ -178,19 +179,18 @@ void AppLauncherLoginHandler::UpdateLogin() {
std::string icon_url;
Profile* profile = Profile::FromWebUI(web_ui());
if (!username.empty()) {
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (profile_index != std::string::npos) {
+ ProfileAttributesStorage& storage =
+ g_browser_process->profile_manager()->GetProfileAttributesStorage();
+ ProfileAttributesEntry* entry;
+ if (storage.GetProfileAttributesWithPath(profile->GetPath(), &entry)) {
// Only show the profile picture and full name for the single profile
// case. In the multi-profile case the profile picture is visible in the
// title bar and the full name can be ambiguous.
- if (cache.GetNumberOfProfiles() == 1) {
- base::string16 name = cache.GetGAIANameOfProfileAtIndex(profile_index);
+ if (storage.GetNumberOfProfiles() == 1) {
+ base::string16 name = entry->GetGAIAName();
if (!name.empty())
header = CreateElementWithClass(name, "span", "profile-name", "");
- const gfx::Image* image =
- cache.GetGAIAPictureOfProfileAtIndex(profile_index);
+ const gfx::Image* image = entry->GetGAIAPicture();
if (image)
icon_url = webui::GetBitmapDataUrl(GetGAIAPictureForNTP(*image));
}
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698