| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Menu commands | 64 // Menu commands |
| 65 constexpr int kToggleQuietMode = 0; | 65 constexpr int kToggleQuietMode = 0; |
| 66 constexpr int kEnableQuietModeDay = 2; | 66 constexpr int kEnableQuietModeDay = 2; |
| 67 | 67 |
| 68 constexpr int kMaximumSmallIconCount = 3; | 68 constexpr int kMaximumSmallIconCount = 3; |
| 69 | 69 |
| 70 constexpr gfx::Size kTrayItemInnerIconSize(16, 16); | 70 constexpr gfx::Size kTrayItemInnerIconSize(16, 16); |
| 71 constexpr gfx::Size kTrayItemInnerBellIconSizeNonMd(18, 18); | 71 constexpr gfx::Size kTrayItemInnerBellIconSizeNonMd(18, 18); |
| 72 constexpr gfx::Size kTrayItemOuterSize(26, 26); | 72 constexpr gfx::Size kTrayItemOuterSize(26, 26); |
| 73 constexpr gfx::Insets kTrayItemInsets(3, 3); | 73 constexpr int kTrayMainAxisInset = 3; |
| 74 constexpr int kTrayCrossAxisInset = 0; |
| 74 | 75 |
| 75 constexpr int kTrayItemAnimationDurationMS = 200; | 76 constexpr int kTrayItemAnimationDurationMS = 200; |
| 76 | 77 |
| 77 constexpr size_t kMaximumNotificationNumber = 99; | 78 constexpr size_t kMaximumNotificationNumber = 99; |
| 78 | 79 |
| 79 // Flag to disable animation. Only for testing. | 80 // Flag to disable animation. Only for testing. |
| 80 bool disable_animations_for_test = false; | 81 bool disable_animations_for_test = false; |
| 81 } | 82 } |
| 82 | 83 |
| 83 namespace { | 84 namespace { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 popup_alignment_delegate_.reset(new AshPopupAlignmentDelegate(shelf)); | 328 popup_alignment_delegate_.reset(new AshPopupAlignmentDelegate(shelf)); |
| 328 popup_collection_.reset(new message_center::MessagePopupCollection( | 329 popup_collection_.reset(new message_center::MessagePopupCollection( |
| 329 message_center(), message_center_tray_.get(), | 330 message_center(), message_center_tray_.get(), |
| 330 popup_alignment_delegate_.get())); | 331 popup_alignment_delegate_.get())); |
| 331 const display::Display& display = | 332 const display::Display& display = |
| 332 status_area_window_->GetDisplayNearestWindow(); | 333 status_area_window_->GetDisplayNearestWindow(); |
| 333 popup_alignment_delegate_->StartObserving(display::Screen::GetScreen(), | 334 popup_alignment_delegate_->StartObserving(display::Screen::GetScreen(), |
| 334 display); | 335 display); |
| 335 OnMessageCenterTrayChanged(); | 336 OnMessageCenterTrayChanged(); |
| 336 | 337 |
| 337 tray_container()->SetMargin(kTrayItemInsets); | 338 tray_container()->SetMargin(kTrayMainAxisInset, kTrayCrossAxisInset); |
| 338 } | 339 } |
| 339 | 340 |
| 340 WebNotificationTray::~WebNotificationTray() { | 341 WebNotificationTray::~WebNotificationTray() { |
| 341 // Release any child views that might have back pointers before ~View(). | 342 // Release any child views that might have back pointers before ~View(). |
| 342 message_center_bubble_.reset(); | 343 message_center_bubble_.reset(); |
| 343 popup_alignment_delegate_.reset(); | 344 popup_alignment_delegate_.reset(); |
| 344 popup_collection_.reset(); | 345 popup_collection_.reset(); |
| 345 } | 346 } |
| 346 | 347 |
| 347 // static | 348 // static |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 | 667 |
| 667 message_center::MessageCenterBubble* | 668 message_center::MessageCenterBubble* |
| 668 WebNotificationTray::GetMessageCenterBubbleForTest() { | 669 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 669 if (!message_center_bubble()) | 670 if (!message_center_bubble()) |
| 670 return nullptr; | 671 return nullptr; |
| 671 return static_cast<message_center::MessageCenterBubble*>( | 672 return static_cast<message_center::MessageCenterBubble*>( |
| 672 message_center_bubble()->bubble()); | 673 message_center_bubble()->bubble()); |
| 673 } | 674 } |
| 674 | 675 |
| 675 } // namespace ash | 676 } // namespace ash |
| OLD | NEW |