summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 23:42:41 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 23:42:41 +0000
commit9c45e0fcdfd5e58bc5e6f98c771578f0d512b62b (patch)
tree05a12cb365e1da8bb04183bd73cbf2ad4b02ad03
parent49a908391a4afb0da92fedd350d5006e9c4ee39b (diff)
downloadchromium_src-9c45e0fcdfd5e58bc5e6f98c771578f0d512b62b.zip
chromium_src-9c45e0fcdfd5e58bc5e6f98c771578f0d512b62b.tar.gz
chromium_src-9c45e0fcdfd5e58bc5e6f98c771578f0d512b62b.tar.bz2
Merge 238549 "Taskbar runtime profile badge should not use Incog..."
> Taskbar runtime profile badge should not use Incognito icon. > > This CL changes the taskbar profile badge to use the profile's avatar > icon when the browser window is OTR. > > This is necessary because the profile badge needs to match the shortcut > that is pinned to the taskbar, which won't use the incognito icon. > > Previously, the taskbar badge would be dependent on the > OTR status of the last browser window to be opened. > > BUG=318652 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235587 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235927 > > Review URL: https://codereview.chromium.org/71653004 TBR=calamity@chromium.org Review URL: https://codereview.chromium.org/109483007 git-svn-id: svn://svn.chromium.org/chrome/branches/1700/src@239608 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/frame/browser_non_client_frame_view.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
index 0840c71..be18c4a 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -87,12 +87,22 @@ void BrowserNonClientFrameView::UpdateAvatarInfo() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
gfx::Image avatar;
+ gfx::Image taskbar_badge_avatar;
string16 text;
bool is_rectangle = false;
if (browser_view_->IsGuestSession()) {
avatar = rb.GetImageNamed(browser_view_->GetGuestIconResourceID());
} else if (browser_view_->IsOffTheRecord()) {
avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID());
+ // TODO(nkostylev): Allow this on ChromeOS once the ChromeOS test
+ // environment handles profile directories correctly.
+#if !defined(OS_CHROMEOS)
+ bool is_badge_rectangle = false;
+ // The taskbar badge should be the profile avatar, not the OTR avatar.
+ AvatarMenu::GetImageForMenuButton(browser_view_->browser()->profile(),
+ &taskbar_badge_avatar,
+ &is_badge_rectangle);
+#endif
} else if (avatar_button_ || AvatarMenu::ShouldShowAvatarMenu()) {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
@@ -125,7 +135,9 @@ void BrowserNonClientFrameView::UpdateAvatarInfo() {
// See crbug.com/313800.
chrome::DrawTaskbarDecoration(
frame_->GetNativeWindow(),
- AvatarMenu::ShouldShowAvatarMenu() ? &avatar : NULL);
+ AvatarMenu::ShouldShowAvatarMenu()
+ ? (taskbar_badge_avatar.IsEmpty() ? &avatar : &taskbar_badge_avatar)
+ : NULL);
}
void BrowserNonClientFrameView::UpdateNewStyleAvatarInfo(