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

Unified Diff: chrome/browser/ui/webui/options/personal_options_handler.cc

Issue 8711002: Add GAIA picture to Settings profile overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/manage_profile_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/personal_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/personal_options_handler.cc b/chrome/browser/ui/webui/options/personal_options_handler.cc
index da13c1b344c3ab07ed7fc09a489074d3c622daab..8a2226dc39689f1dd9c461cd48284b1ca5ab4448 100644
--- a/chrome/browser/ui/webui/options/personal_options_handler.cc
+++ b/chrome/browser/ui/webui/options/personal_options_handler.cc
@@ -20,12 +20,14 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_info_util.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_setup_flow.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
+#include "chrome/browser/ui/webui/web_ui_util.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -408,14 +410,25 @@ void PersonalOptionsHandler::SendProfilesInfo() {
web_ui_->tab_contents()->browser_context()->GetPath();
for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) {
DictionaryValue* profile_value = new DictionaryValue();
- size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(i);
FilePath profile_path = cache.GetPathOfProfileAtIndex(i);
profile_value->SetString("name", cache.GetNameOfProfileAtIndex(i));
- profile_value->SetString("iconURL",
- cache.GetDefaultAvatarIconUrl(icon_index));
profile_value->Set("filePath", base::CreateFilePathValue(profile_path));
profile_value->SetBoolean("isCurrentProfile",
profile_path == current_profile_path);
+
+ bool is_gaia_picture =
+ cache.IsUsingGAIAPictureOfProfileAtIndex(i) &&
+ cache.GetGAIAPictureOfProfileAtIndex(i);
+ if (is_gaia_picture) {
+ gfx::Image icon = profiles::GetAvatarIconForWebUI(
+ cache.GetAvatarIconOfProfileAtIndex(i), true);
+ profile_value->SetString("iconURL", web_ui_util::GetImageDataUrl(icon));
+ } else {
+ size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(i);
+ profile_value->SetString("iconURL",
+ cache.GetDefaultAvatarIconUrl(icon_index));
+ }
+
profile_info_list.Append(profile_value);
}
« no previous file with comments | « chrome/browser/ui/webui/options/manage_profile_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698