0

[Win] Use the default, non-high-res avatar when badging the taskbar.

BUG=374173
TEST=Start Chrome with --new-profile-management. Open and 'Incognito' window.
The taksbar icon should now have a grey background.

Review URL: https://codereview.chromium.org/286933008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271862 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
noms@chromium.org
2014-05-21 04:32:39 +00:00
parent 08d8f5def0
commit dbb2ebf039

@ -6,8 +6,10 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "ui/base/resource/resource_bundle.h"
// static
void AvatarMenu::GetImageForMenuButton(Profile* profile,
@ -21,7 +23,11 @@ void AvatarMenu::GetImageForMenuButton(Profile* profile,
return;
}
*image = cache.GetAvatarIconOfProfileAtIndex(index);
// Ensure we are using the default resource, not the downloaded high-res one.
const size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
const int resource_id =
profiles::GetDefaultAvatarIconResourceIDAtIndex(icon_index);
*image = ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
*is_rectangle =
cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
cache.GetGAIAPictureOfProfileAtIndex(index);