| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 : TrayBackgroundView(shelf), | 290 : TrayBackgroundView(shelf), |
| 291 status_area_window_(status_area_window), | 291 status_area_window_(status_area_window), |
| 292 system_tray_(system_tray), | 292 system_tray_(system_tray), |
| 293 show_message_center_on_unlock_(false), | 293 show_message_center_on_unlock_(false), |
| 294 should_update_tray_content_(false), | 294 should_update_tray_content_(false), |
| 295 should_block_shelf_auto_hide_(false) { | 295 should_block_shelf_auto_hide_(false) { |
| 296 DCHECK(shelf); | 296 DCHECK(shelf); |
| 297 DCHECK(status_area_window_); | 297 DCHECK(status_area_window_); |
| 298 DCHECK(system_tray_); | 298 DCHECK(system_tray_); |
| 299 | 299 |
| 300 SetContentsBackground(); |
| 300 if (MaterialDesignController::IsShelfMaterial()) { | 301 if (MaterialDesignController::IsShelfMaterial()) { |
| 301 SetInkDropMode(InkDropMode::ON); | 302 SetInkDropMode(InkDropMode::ON); |
| 302 SetContentsBackground(false); | |
| 303 gfx::ImageSkia bell_image = | 303 gfx::ImageSkia bell_image = |
| 304 CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor); | 304 CreateVectorIcon(kShelfNotificationsIcon, kShelfIconColor); |
| 305 const gfx::Size bell_icon_size = kTrayItemInnerIconSize; | 305 const gfx::Size bell_icon_size = kTrayItemInnerIconSize; |
| 306 bell_icon_.reset(new WebNotificationImage( | 306 bell_icon_.reset(new WebNotificationImage( |
| 307 bell_image, bell_icon_size, animation_container_.get(), this)); | 307 bell_image, bell_icon_size, animation_container_.get(), this)); |
| 308 } else { | 308 } else { |
| 309 SetContentsBackground(true); | |
| 310 gfx::ImageSkia bell_image = | 309 gfx::ImageSkia bell_image = |
| 311 CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, | 310 CreateVectorIcon(gfx::VectorIconId::NOTIFICATIONS, kNoUnreadIconSize, |
| 312 kWebNotificationColorNoUnread); | 311 kWebNotificationColorNoUnread); |
| 313 const gfx::Size bell_icon_size = kTrayItemInnerBellIconSizeNonMd; | 312 const gfx::Size bell_icon_size = kTrayItemInnerBellIconSizeNonMd; |
| 314 bell_icon_.reset(new WebNotificationImage( | 313 bell_icon_.reset(new WebNotificationImage( |
| 315 bell_image, bell_icon_size, animation_container_.get(), this)); | 314 bell_image, bell_icon_size, animation_container_.get(), this)); |
| 316 } | 315 } |
| 317 tray_container()->AddChildView(bell_icon_.get()); | 316 tray_container()->AddChildView(bell_icon_.get()); |
| 318 | 317 |
| 319 counter_.reset(new WebNotificationLabel(animation_container_.get(), this)); | 318 counter_.reset(new WebNotificationLabel(animation_container_.get(), this)); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 657 |
| 659 message_center::MessageCenterBubble* | 658 message_center::MessageCenterBubble* |
| 660 WebNotificationTray::GetMessageCenterBubbleForTest() { | 659 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 661 if (!message_center_bubble()) | 660 if (!message_center_bubble()) |
| 662 return nullptr; | 661 return nullptr; |
| 663 return static_cast<message_center::MessageCenterBubble*>( | 662 return static_cast<message_center::MessageCenterBubble*>( |
| 664 message_center_bubble()->bubble()); | 663 message_center_bubble()->bubble()); |
| 665 } | 664 } |
| 666 | 665 |
| 667 } // namespace ash | 666 } // namespace ash |
| OLD | NEW |