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

Unified Diff: chrome/browser/profiles/avatar_menu_model.cc

Issue 8700014: Utility to draw GAIA pictures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
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 5ff3e8cb9ff452f0341f4e4cbfd9db6cd062f9bd..e4d67093b7d8d492fd642667285e6d333af06c12 100644
--- a/chrome/browser/profiles/avatar_menu_model.cc
+++ b/chrome/browser/profiles/avatar_menu_model.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/avatar_menu_model_observer.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/profiles/profile_metrics.h"
#include "chrome/browser/ui/browser.h"
@@ -21,7 +22,6 @@
#include "content/public/browser/notification_service.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/image/image.h"
using content::BrowserThread;
@@ -151,7 +151,13 @@ void AvatarMenuModel::RebuildMenu() {
const size_t count = profile_info_->GetNumberOfProfiles();
for (size_t i = 0; i < count; ++i) {
- Item* item = new Item(i, profile_info_->GetAvatarIconOfProfileAtIndex(i));
+ bool is_gaia_picture =
+ profile_info_->IsUsingGAIAPictureOfProfileAtIndex(i) &&
+ !profile_info_->GetGAIAPictureOfProfileAtIndex(i).IsNull();
+ gfx::Image icon = profiles::GetAvatarIconForMenu(
+ profile_info_->GetAvatarIconOfProfileAtIndex(i), is_gaia_picture);
+
+ Item* item = new Item(i, icon);
item->name = profile_info_->GetNameOfProfileAtIndex(i);
item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i);
if (item->sync_state.empty()) {

Powered by Google App Engine
This is Rietveld 408576698