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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view.cc

Issue 12212053: Moves calling TaskbarList::SetOverlayIcon to a separate thread. It (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/frame/browser_non_client_frame_view.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/managed_mode/managed_mode.h" 8 #include "chrome/browser/managed_mode/managed_mode.h"
9 #include "chrome/browser/profiles/avatar_menu_model.h" 9 #include "chrome/browser/profiles/avatar_menu_model.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/profiles/profile_info_cache.h" 11 #include "chrome/browser/profiles/profile_info_cache.h"
12 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/browser/ui/views/avatar_menu_button.h" 13 #include "chrome/browser/ui/views/avatar_menu_button.h"
14 #include "chrome/browser/ui/views/frame/browser_view.h" 14 #include "chrome/browser/ui/views/frame/browser_view.h"
15 #include "chrome/browser/ui/views/frame/taskbar_decorator.h"
15 #include "grit/theme_resources.h" 16 #include "grit/theme_resources.h"
16 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/gfx/image/image.h" 18 #include "ui/gfx/image/image.h"
18 19
19 BrowserNonClientFrameView::BrowserNonClientFrameView(BrowserFrame* frame, 20 BrowserNonClientFrameView::BrowserNonClientFrameView(BrowserFrame* frame,
20 BrowserView* browser_view) 21 BrowserView* browser_view)
21 : frame_(frame), 22 : frame_(frame),
22 browser_view_(browser_view) { 23 browser_view_(browser_view) {
23 } 24 }
24 25
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 if (avatar_button_.get()) { 65 if (avatar_button_.get()) {
65 avatar_button_->SetAvatarIcon(avatar, is_gaia_picture); 66 avatar_button_->SetAvatarIcon(avatar, is_gaia_picture);
66 if (!text.empty()) 67 if (!text.empty())
67 avatar_button_->SetText(text); 68 avatar_button_->SetText(text);
68 } 69 }
69 70
70 // For popups and panels which don't have the avatar button, we still 71 // For popups and panels which don't have the avatar button, we still
71 // need to draw the taskbar decoration. 72 // need to draw the taskbar decoration.
72 if (AvatarMenuModel::ShouldShowAvatarMenu() || 73 if (AvatarMenuModel::ShouldShowAvatarMenu() ||
73 ManagedMode::IsInManagedMode()) { 74 ManagedMode::IsInManagedMode()) {
74 DrawTaskBarDecoration(frame_->GetNativeWindow(), &avatar); 75 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &avatar);
75 } else { 76 } else {
76 DrawTaskBarDecoration(frame_->GetNativeWindow(), NULL); 77 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), NULL);
77 } 78 }
78 } 79 }
79 80
80 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from, 81 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
81 bool is_visible) { 82 bool is_visible) {
82 if (!is_visible) 83 if (!is_visible)
83 return; 84 return;
84 // The first time UpdateAvatarInfo() is called the window is not visible so 85 // The first time UpdateAvatarInfo() is called the window is not visible so
85 // DrawTaskBarDecoration() has no effect. Therefore we need to call it again 86 // DrawTaskBarDecoration() has no effect. Therefore we need to call it again
86 // once the window is visible. 87 // once the window is visible.
87 UpdateAvatarInfo(); 88 UpdateAvatarInfo();
88 } 89 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button.cc ('k') | chrome/browser/ui/views/frame/taskbar_decorator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698