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

Unified Diff: ash/system/tray/system_tray_bubble.cc

Issue 10566003: ash: Fix arrow color for the uber-tray popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/system/tray/tray_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray_bubble.cc
diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc
index d737b9df51c6c33a8622263ba7e60d88b4ca19ab..27bdc2a8902347aef1f1b4785a927a270b1b437f 100644
--- a/ash/system/tray/system_tray_bubble.cc
+++ b/ash/system/tray/system_tray_bubble.cc
@@ -72,10 +72,12 @@ class TrayPopupItemBorder : public views::Border {
};
// A view with some special behaviour for tray items in the popup:
-// - changes background color on hover.
+// - optionally changes background color on hover.
class TrayPopupItemContainer : public views::View {
public:
- explicit TrayPopupItemContainer(views::View* view) : hover_(false) {
+ TrayPopupItemContainer(views::View* view, bool change_background)
+ : hover_(false),
+ change_background_(change_background) {
set_notify_enter_exit_on_child(true);
set_border(new TrayPopupItemBorder(this));
views::BoxLayout* layout = new views::BoxLayout(
@@ -120,12 +122,13 @@ class TrayPopupItemContainer : public views::View {
views::View* view = child_at(0);
if (!view->background()) {
- canvas->FillRect(gfx::Rect(size()),
- hover_ ? kHoverBackgroundColor : kBackgroundColor);
+ canvas->FillRect(gfx::Rect(size()), (hover_ && change_background_) ?
+ kHoverBackgroundColor : kBackgroundColor);
}
}
bool hover_;
+ bool change_background_;
DISALLOW_COPY_AND_ASSIGN(TrayPopupItemContainer);
};
@@ -453,8 +456,10 @@ void SystemTrayBubble::CreateItemViews(user::LoginStatus login_status) {
view = (*it)->CreateNotificationView(login_status);
break;
}
- if (view)
- bubble_view_->AddChildView(new TrayPopupItemContainer(view));
+ if (view) {
+ bubble_view_->AddChildView(new TrayPopupItemContainer(
+ view, bubble_type_ == BUBBLE_TYPE_DEFAULT));
+ }
}
}
« no previous file with comments | « no previous file | ash/system/tray/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698