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

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

Issue 286933008: [Win] Use the default, non-high-res avatar when badging the taskbar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/avatar_menu.h" 5 #include "chrome/browser/profiles/avatar_menu.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
9 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
10 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "ui/base/resource/resource_bundle.h"
11 13
12 // static 14 // static
13 void AvatarMenu::GetImageForMenuButton(Profile* profile, 15 void AvatarMenu::GetImageForMenuButton(Profile* profile,
14 gfx::Image* image, 16 gfx::Image* image,
15 bool* is_rectangle) { 17 bool* is_rectangle) {
16 ProfileInfoCache& cache = 18 ProfileInfoCache& cache =
17 g_browser_process->profile_manager()->GetProfileInfoCache(); 19 g_browser_process->profile_manager()->GetProfileInfoCache();
18 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); 20 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
19 if (index == std::string::npos) { 21 if (index == std::string::npos) {
20 NOTREACHED(); 22 NOTREACHED();
21 return; 23 return;
22 } 24 }
23 25
24 *image = cache.GetAvatarIconOfProfileAtIndex(index); 26 // Ensure we are using the default resource, not the downloaded high-res one.
27 const size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
28 const int resource_id =
29 profiles::GetDefaultAvatarIconResourceIDAtIndex(icon_index);
30 *image = ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
25 *is_rectangle = 31 *is_rectangle =
26 cache.IsUsingGAIAPictureOfProfileAtIndex(index) && 32 cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
27 cache.GetGAIAPictureOfProfileAtIndex(index); 33 cache.GetGAIAPictureOfProfileAtIndex(index);
28 } 34 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698