OLD | NEW |
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 "ash/system/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be | 135 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be |
136 // in ash_strings. | 136 // in ash_strings. |
137 unread_label_->SetText((unread_count > 9) ? | 137 unread_label_->SetText((unread_count > 9) ? |
138 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) : | 138 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) : |
139 base::FormatNumber(unread_count)); | 139 base::FormatNumber(unread_count)); |
140 UpdateIconVisibility(); | 140 UpdateIconVisibility(); |
141 } | 141 } |
142 | 142 |
143 protected: | 143 protected: |
144 // Overridden from views::ImageButton: | 144 // Overridden from views::ImageButton: |
145 virtual gfx::Size GetPreferredSize() const OVERRIDE { | 145 virtual gfx::Size GetPreferredSize() const override { |
146 return gfx::Size(kShelfItemHeight, kShelfItemHeight); | 146 return gfx::Size(kShelfItemHeight, kShelfItemHeight); |
147 } | 147 } |
148 | 148 |
149 virtual int GetHeightForWidth(int width) const OVERRIDE { | 149 virtual int GetHeightForWidth(int width) const override { |
150 return GetPreferredSize().height(); | 150 return GetPreferredSize().height(); |
151 } | 151 } |
152 | 152 |
153 private: | 153 private: |
154 void UpdateIconVisibility() { | 154 void UpdateIconVisibility() { |
155 unread_label_->SetEnabledColor( | 155 unread_label_->SetEnabledColor( |
156 (!is_bubble_visible_ && unread_count_ > 0) ? | 156 (!is_bubble_visible_ && unread_count_ > 0) ? |
157 kWebNotificationColorWithUnread : kWebNotificationColorNoUnread); | 157 kWebNotificationColorWithUnread : kWebNotificationColorNoUnread); |
158 SchedulePaint(); | 158 SchedulePaint(); |
159 } | 159 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 message_center::MessageCenterBubble* | 494 message_center::MessageCenterBubble* |
495 WebNotificationTray::GetMessageCenterBubbleForTest() { | 495 WebNotificationTray::GetMessageCenterBubbleForTest() { |
496 if (!message_center_bubble()) | 496 if (!message_center_bubble()) |
497 return NULL; | 497 return NULL; |
498 return static_cast<message_center::MessageCenterBubble*>( | 498 return static_cast<message_center::MessageCenterBubble*>( |
499 message_center_bubble()->bubble()); | 499 message_center_bubble()->bubble()); |
500 } | 500 } |
501 | 501 |
502 } // namespace ash | 502 } // namespace ash |
OLD | NEW |