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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be | 260 // TODO(mukai): move NINE_PLUS message to ui_strings, it doesn't need to be |
261 // in ash_strings. | 261 // in ash_strings. |
262 unread_label_->SetText((unread_count > 9) ? | 262 unread_label_->SetText((unread_count > 9) ? |
263 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) : | 263 l10n_util::GetStringUTF16(IDS_ASH_NOTIFICATION_UNREAD_COUNT_NINE_PLUS) : |
264 base::FormatNumber(unread_count)); | 264 base::FormatNumber(unread_count)); |
265 UpdateIconVisibility(); | 265 UpdateIconVisibility(); |
266 } | 266 } |
267 | 267 |
268 protected: | 268 protected: |
269 // Overridden from views::ImageButton: | 269 // Overridden from views::ImageButton: |
270 virtual gfx::Size GetPreferredSize() OVERRIDE { | 270 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
271 return gfx::Size(kShelfItemHeight, kShelfItemHeight); | 271 return gfx::Size(kShelfItemHeight, kShelfItemHeight); |
272 } | 272 } |
273 | 273 |
274 virtual int GetHeightForWidth(int width) OVERRIDE { | 274 virtual int GetHeightForWidth(int width) OVERRIDE { |
275 return GetPreferredSize().height(); | 275 return GetPreferredSize().height(); |
276 } | 276 } |
277 | 277 |
278 private: | 278 private: |
279 void UpdateIconVisibility() { | 279 void UpdateIconVisibility() { |
280 unread_label_->SetEnabledColor( | 280 unread_label_->SetEnabledColor( |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 | 611 |
612 message_center::MessageCenterBubble* | 612 message_center::MessageCenterBubble* |
613 WebNotificationTray::GetMessageCenterBubbleForTest() { | 613 WebNotificationTray::GetMessageCenterBubbleForTest() { |
614 if (!message_center_bubble()) | 614 if (!message_center_bubble()) |
615 return NULL; | 615 return NULL; |
616 return static_cast<message_center::MessageCenterBubble*>( | 616 return static_cast<message_center::MessageCenterBubble*>( |
617 message_center_bubble()->bubble()); | 617 message_center_bubble()->bubble()); |
618 } | 618 } |
619 | 619 |
620 } // namespace ash | 620 } // namespace ash |
OLD | NEW |