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

Unified Diff: chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm

Issue 21308002: Update Mac notification tray behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac tests. Created 7 years, 5 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 | chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm
diff --git a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm
index 405aabf62b71ec81db4283ae934e708c49890406..1df629efc5ef187f869c83d95d317ee87013c0b5 100644
--- a/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm
+++ b/chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.mm
@@ -76,6 +76,7 @@ void MessageCenterTrayBridge::HideMessageCenter() {
[status_item_view_ setHighlight:NO];
[tray_controller_ close];
tray_controller_.autorelease();
+ UpdateStatusItem();
}
bool MessageCenterTrayBridge::ShowNotifierSettings() {
@@ -85,20 +86,18 @@ bool MessageCenterTrayBridge::ShowNotifierSettings() {
}
void MessageCenterTrayBridge::UpdateStatusItem() {
- // Only show the status item if there are notifications.
- if (message_center_->NotificationCount() == 0) {
- [status_item_view_ removeItem];
- status_item_view_.reset();
- return;
- }
-
if (!status_item_view_) {
status_item_view_.reset([[MCStatusItemView alloc] init]);
[status_item_view_ setCallback:^{ tray_->ToggleMessageCenterBubble(); }];
}
+ // We want a static message center icon while it's visible.
+ if (message_center()->IsMessageCenterVisible())
+ return;
+
size_t unread_count = message_center_->UnreadNotificationCount();
- [status_item_view_ setUnreadCount:unread_count];
+ bool quiet_mode = message_center_->IsQuietMode();
+ [status_item_view_ setUnreadCount:unread_count withQuietMode:quiet_mode];
string16 product_name = l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
if (unread_count > 0) {
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/notifications/message_center_tray_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698