summaryrefslogtreecommitdiffstats
path: root/ash/system/web_notification
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 19:46:22 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 19:46:22 +0000
commitb8be4880e1eaf31edc1c6b85682de4e13c19f016 (patch)
treee1a9fe2f842e3a910b04146e24c260f8ffcfe805 /ash/system/web_notification
parent60036f6b4ae5cba5909ee7fc1169a02dbed2c1d9 (diff)
downloadchromium_src-b8be4880e1eaf31edc1c6b85682de4e13c19f016.zip
chromium_src-b8be4880e1eaf31edc1c6b85682de4e13c19f016.tar.gz
chromium_src-b8be4880e1eaf31edc1c6b85682de4e13c19f016.tar.bz2
Hide the Ash web notification tray when there are no notifications
This also adjusts the color for read notifications to be more subtle. (If we don't like that we can also easily change them or make both colors the same). BUG=144524 Review URL: https://chromiumcodereview.appspot.com/10875042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/web_notification')
-rw-r--r--ash/system/web_notification/web_notification_tray.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 307f9a5..ed3675c 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -59,7 +59,9 @@ const int kUpdateDelayMs = 50;
const int kMaxVisibleNotifications = 100;
const int kAutocloseDelaySeconds = 5;
const SkColor kMessageCountColor = SkColorSetARGB(0xff, 0xff, 0xff, 0xff);
-const SkColor kMessageCountDimmedColor = SkColorSetARGB(0x60, 0xff, 0xff, 0xff);
+const SkColor kNotificationColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
+const SkColor kNotificationReadColor = SkColorSetRGB(0xfa, 0xfa, 0xfa);
+
// Individual notifications constants
const int kWebNotificationWidth = 320;
@@ -358,8 +360,8 @@ class WebNotificationView : public views::View,
const WebNotification& notification) {
set_border(views::Border::CreateSolidSidedBorder(
1, 0, 0, 0, kBorderLightColor));
- SkColor bg_color = notification.is_read
- ? kHeaderBackgroundColorLight : kBackgroundColor;
+ SkColor bg_color = notification.is_read ?
+ kNotificationReadColor : kNotificationColor;
set_background(views::Background::CreateSolidBackground(bg_color));
SetPaintToLayer(true);
SetFillsBoundsOpaquely(false);
@@ -946,7 +948,7 @@ WebNotificationTray::WebNotificationTray(
gfx::Font font = count_label_->font();
count_label_->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD));
count_label_->SetHorizontalAlignment(views::Label::ALIGN_CENTER);
- count_label_->SetEnabledColor(kMessageCountDimmedColor);
+ count_label_->SetEnabledColor(kMessageCountColor);
tray_container()->set_size(gfx::Size(kTrayWidth, kTrayHeight));
tray_container()->AddChildView(count_label_);
@@ -1178,13 +1180,10 @@ void WebNotificationTray::OnClicked(const std::string& id) {
void WebNotificationTray::UpdateTray() {
count_label_->SetText(UTF8ToUTF16(
GetNotificationText(notification_list()->unread_count())));
- // Dim the message count text only if the message center is empty.
- count_label_->SetEnabledColor(
- (notification_list()->notifications().size() == 0) ?
- kMessageCountDimmedColor : kMessageCountColor);
bool is_visible =
(status_area_widget()->login_status() != user::LOGGED_IN_NONE) &&
- (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED);
+ (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED) &&
+ (!notification_list()->notifications().empty());
SetVisible(is_visible);
Layout();
SchedulePaint();