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/common/system/web_notification/web_notification_tray.h" | 5 #include "ash/common/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
9 #include "ash/common/shelf/shelf_constants.h" | 9 #include "ash/common/shelf/shelf_constants.h" |
10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 private: | 279 private: |
280 views::Label* view_; | 280 views::Label* view_; |
281 | 281 |
282 DISALLOW_COPY_AND_ASSIGN(WebNotificationLabel); | 282 DISALLOW_COPY_AND_ASSIGN(WebNotificationLabel); |
283 }; | 283 }; |
284 | 284 |
285 WebNotificationTray::WebNotificationTray(WmShelf* shelf, | 285 WebNotificationTray::WebNotificationTray(WmShelf* shelf, |
286 WmWindow* status_area_window, | 286 WmWindow* status_area_window, |
287 SystemTray* system_tray) | 287 SystemTray* system_tray) |
288 : TrayBackgroundView(shelf), | 288 : TrayBackgroundView(shelf, true), |
289 status_area_window_(status_area_window), | 289 status_area_window_(status_area_window), |
290 system_tray_(system_tray), | 290 system_tray_(system_tray), |
291 show_message_center_on_unlock_(false), | 291 show_message_center_on_unlock_(false), |
292 should_update_tray_content_(false), | 292 should_update_tray_content_(false), |
293 should_block_shelf_auto_hide_(false) { | 293 should_block_shelf_auto_hide_(false) { |
294 DCHECK(shelf); | 294 DCHECK(shelf); |
295 DCHECK(status_area_window_); | 295 DCHECK(status_area_window_); |
296 DCHECK(system_tray_); | 296 DCHECK(system_tray_); |
297 | 297 |
298 if (MaterialDesignController::IsShelfMaterial()) { | 298 if (MaterialDesignController::IsShelfMaterial()) { |
299 SetInkDropMode(InkDropMode::ON); | 299 SetInkDropMode(InkDropMode::ON); |
300 SetContentsBackground(false); | |
301 gfx::ImageSkia bell_image = | 300 gfx::ImageSkia bell_image = |
302 CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor); | 301 CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor); |
303 const gfx::Size bell_icon_size = kTrayItemInnerIconSize; | 302 const gfx::Size bell_icon_size = kTrayItemInnerIconSize; |
304 bell_icon_.reset(new WebNotificationImage( | 303 bell_icon_.reset(new WebNotificationImage( |
305 bell_image, bell_icon_size, animation_container_.get(), this)); | 304 bell_image, bell_icon_size, animation_container_.get(), this)); |
306 } else { | 305 } else { |
307 SetContentsBackground(true); | |
308 gfx::ImageSkia bell_image = | 306 gfx::ImageSkia bell_image = |
309 CreateVectorIcon(ui::kNotificationsIcon, kNoUnreadIconSize, | 307 CreateVectorIcon(ui::kNotificationsIcon, kNoUnreadIconSize, |
310 kWebNotificationColorNoUnread); | 308 kWebNotificationColorNoUnread); |
311 const gfx::Size bell_icon_size = kTrayItemInnerBellIconSizeNonMd; | 309 const gfx::Size bell_icon_size = kTrayItemInnerBellIconSizeNonMd; |
312 bell_icon_.reset(new WebNotificationImage( | 310 bell_icon_.reset(new WebNotificationImage( |
313 bell_image, bell_icon_size, animation_container_.get(), this)); | 311 bell_image, bell_icon_size, animation_container_.get(), this)); |
314 } | 312 } |
315 tray_container()->AddChildView(bell_icon_.get()); | 313 tray_container()->AddChildView(bell_icon_.get()); |
316 | 314 |
317 counter_.reset(new WebNotificationLabel(animation_container_.get(), this)); | 315 counter_.reset(new WebNotificationLabel(animation_container_.get(), this)); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 | 650 |
653 message_center::MessageCenterBubble* | 651 message_center::MessageCenterBubble* |
654 WebNotificationTray::GetMessageCenterBubbleForTest() { | 652 WebNotificationTray::GetMessageCenterBubbleForTest() { |
655 if (!message_center_bubble()) | 653 if (!message_center_bubble()) |
656 return nullptr; | 654 return nullptr; |
657 return static_cast<message_center::MessageCenterBubble*>( | 655 return static_cast<message_center::MessageCenterBubble*>( |
658 message_center_bubble()->bubble()); | 656 message_center_bubble()->bubble()); |
659 } | 657 } |
660 | 658 |
661 } // namespace ash | 659 } // namespace ash |
OLD | NEW |