Chromium Code Reviews| 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_md = CreateVectorIcon( |
|
James Cook
2016/06/09 19:24:48
ditto
tdanderson
2016/06/09 22:36:33
Done.
| |
| 127 gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, | 129 gfx::VectorIconId::SHELF_NOTIFICATIONS, kShelfIconColor); |
| 128 kWebNotificationColorNoUnread)); | 130 gfx::ImageSkia image_non_md = |
| 131 CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, | |
| 132 kWebNotificationColorNoUnread); | |
| 133 no_unread_icon_.SetImage( | |
| 134 MaterialDesignController::IsMaterial() ? image_md : image_non_md); | |
| 129 no_unread_icon_.set_owned_by_client(); | 135 no_unread_icon_.set_owned_by_client(); |
| 130 | 136 |
| 131 unread_label_.set_owned_by_client(); | 137 unread_label_.set_owned_by_client(); |
| 132 SetupLabelForTray(&unread_label_); | 138 SetupLabelForTray(&unread_label_); |
| 133 | 139 |
| 134 AddChildView(&unread_label_); | 140 AddChildView(&unread_label_); |
| 135 } | 141 } |
| 136 | 142 |
| 137 void SetBubbleVisible(bool visible) { | 143 void SetBubbleVisible(bool visible) { |
| 138 if (visible == is_bubble_visible_) | 144 if (visible == is_bubble_visible_) |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 | 520 |
| 515 message_center::MessageCenterBubble* | 521 message_center::MessageCenterBubble* |
| 516 WebNotificationTray::GetMessageCenterBubbleForTest() { | 522 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 517 if (!message_center_bubble()) | 523 if (!message_center_bubble()) |
| 518 return NULL; | 524 return NULL; |
| 519 return static_cast<message_center::MessageCenterBubble*>( | 525 return static_cast<message_center::MessageCenterBubble*>( |
| 520 message_center_bubble()->bubble()); | 526 message_center_bubble()->bubble()); |
| 521 } | 527 } |
| 522 | 528 |
| 523 } // namespace ash | 529 } // namespace ash |
| OLD | NEW |