Commit b150474a authored by rsesek@chromium.org's avatar rsesek@chromium.org

[Mac][MC] Add a tooltip for the status item.

BUG=243940

Review URL: https://chromiumcodereview.appspot.com/15917008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202668 0039d316-1c4b-4281-b951-d872f2087c98
parent 8c2a7ecc
......@@ -4,7 +4,12 @@
#include "chrome/browser/ui/cocoa/notifications/message_center_tray_bridge.h"
#include "base/i18n/number_formatting.h"
#include "chrome/browser/browser_process.h"
#include "grit/chromium_strings.h"
#include "grit/ui_strings.h"
#include "ui/base/l10n/l10n_util.h"
#import "ui/base/l10n/l10n_util_mac.h"
#import "ui/message_center/cocoa/popup_collection.h"
#import "ui/message_center/cocoa/status_item_view.h"
#import "ui/message_center/cocoa/tray_controller.h"
......@@ -42,8 +47,20 @@ MessageCenterTrayBridge::~MessageCenterTrayBridge() {
}
void MessageCenterTrayBridge::OnMessageCenterTrayChanged() {
[status_item_view_ setUnreadCount:
message_center_->UnreadNotificationCount()];
size_t unread_count = message_center_->UnreadNotificationCount();
[status_item_view_ setUnreadCount:unread_count];
string16 product_name = l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
if (unread_count > 0) {
string16 unread_count_string = base::FormatNumber(unread_count);
[status_item_view_ setToolTip:
l10n_util::GetNSStringF(IDS_MESSAGE_CENTER_TOOLTIP_UNREAD,
product_name, unread_count_string)];
} else {
[status_item_view_ setToolTip:
l10n_util::GetNSStringF(IDS_MESSAGE_CENTER_TOOLTIP, product_name)];
}
[tray_controller_ onMessageCenterTrayChanged];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment