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/common/material_design/material_design_controller.h" |
| 9 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/shelf/wm_shelf_util.h" | 10 #include "ash/common/shelf/wm_shelf_util.h" |
9 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
10 #include "ash/common/wm_lookup.h" | 12 #include "ash/common/wm_lookup.h" |
11 #include "ash/common/wm_root_window_controller.h" | 13 #include "ash/common/wm_root_window_controller.h" |
12 #include "ash/common/wm_window.h" | 14 #include "ash/common/wm_window.h" |
13 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
14 #include "ash/shelf/shelf_layout_manager.h" | 16 #include "ash/shelf/shelf_layout_manager.h" |
15 #include "ash/shelf/shelf_layout_manager_observer.h" | 17 #include "ash/shelf/shelf_layout_manager_observer.h" |
16 #include "ash/shelf/shelf_util.h" | 18 #include "ash/shelf/shelf_util.h" |
17 #include "ash/shelf/shelf_widget.h" | 19 #include "ash/shelf/shelf_widget.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 }; | 118 }; |
117 | 119 |
118 class WebNotificationButton : public views::CustomButton { | 120 class WebNotificationButton : public views::CustomButton { |
119 public: | 121 public: |
120 WebNotificationButton(views::ButtonListener* listener) | 122 WebNotificationButton(views::ButtonListener* listener) |
121 : views::CustomButton(listener), | 123 : views::CustomButton(listener), |
122 is_bubble_visible_(false), | 124 is_bubble_visible_(false), |
123 unread_count_(0) { | 125 unread_count_(0) { |
124 SetLayoutManager(new views::FillLayout); | 126 SetLayoutManager(new views::FillLayout); |
125 | 127 |
126 no_unread_icon_.SetImage(gfx::CreateVectorIcon( | 128 gfx::ImageSkia image; |
127 gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, | 129 if (MaterialDesignController::IsShelfMaterial()) { |
128 kWebNotificationColorNoUnread)); | 130 image = CreateVectorIcon(gfx::VectorIconId::SHELF_NOTIFICATIONS, |
| 131 kShelfIconColor); |
| 132 } else { |
| 133 image = |
| 134 CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, |
| 135 kWebNotificationColorNoUnread); |
| 136 } |
| 137 |
| 138 no_unread_icon_.SetImage(image); |
129 no_unread_icon_.set_owned_by_client(); | 139 no_unread_icon_.set_owned_by_client(); |
130 | 140 |
131 unread_label_.set_owned_by_client(); | 141 unread_label_.set_owned_by_client(); |
132 SetupLabelForTray(&unread_label_); | 142 SetupLabelForTray(&unread_label_); |
133 | 143 |
134 AddChildView(&unread_label_); | 144 AddChildView(&unread_label_); |
135 } | 145 } |
136 | 146 |
137 void SetBubbleVisible(bool visible) { | 147 void SetBubbleVisible(bool visible) { |
138 if (visible == is_bubble_visible_) | 148 if (visible == is_bubble_visible_) |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 524 |
515 message_center::MessageCenterBubble* | 525 message_center::MessageCenterBubble* |
516 WebNotificationTray::GetMessageCenterBubbleForTest() { | 526 WebNotificationTray::GetMessageCenterBubbleForTest() { |
517 if (!message_center_bubble()) | 527 if (!message_center_bubble()) |
518 return NULL; | 528 return NULL; |
519 return static_cast<message_center::MessageCenterBubble*>( | 529 return static_cast<message_center::MessageCenterBubble*>( |
520 message_center_bubble()->bubble()); | 530 message_center_bubble()->bubble()); |
521 } | 531 } |
522 | 532 |
523 } // namespace ash | 533 } // namespace ash |
OLD | NEW |