| 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 11 matching lines...) Expand all Loading... |
| 22 #include "ash/public/cpp/shell_window_ids.h" | 22 #include "ash/public/cpp/shell_window_ids.h" |
| 23 #include "ash/resources/vector_icons/vector_icons.h" | 23 #include "ash/resources/vector_icons/vector_icons.h" |
| 24 #include "ash/root_window_controller.h" | 24 #include "ash/root_window_controller.h" |
| 25 #include "base/auto_reset.h" | 25 #include "base/auto_reset.h" |
| 26 #include "base/i18n/number_formatting.h" | 26 #include "base/i18n/number_formatting.h" |
| 27 #include "base/i18n/rtl.h" | 27 #include "base/i18n/rtl.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "base/threading/thread_task_runner_handle.h" | 29 #include "base/threading/thread_task_runner_handle.h" |
| 30 #include "grit/ash_strings.h" | 30 #include "grit/ash_strings.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/compositor/layer_type.h" |
| 32 #include "ui/display/display.h" | 33 #include "ui/display/display.h" |
| 33 #include "ui/display/screen.h" | 34 #include "ui/display/screen.h" |
| 34 #include "ui/gfx/paint_vector_icon.h" | 35 #include "ui/gfx/paint_vector_icon.h" |
| 35 #include "ui/gfx/vector_icons_public.h" | 36 #include "ui/gfx/vector_icons_public.h" |
| 36 #include "ui/message_center/message_center_style.h" | 37 #include "ui/message_center/message_center_style.h" |
| 37 #include "ui/message_center/message_center_tray_delegate.h" | 38 #include "ui/message_center/message_center_tray_delegate.h" |
| 38 #include "ui/message_center/views/message_bubble_base.h" | 39 #include "ui/message_center/views/message_bubble_base.h" |
| 39 #include "ui/message_center/views/message_center_bubble.h" | 40 #include "ui/message_center/views/message_center_bubble.h" |
| 40 #include "ui/message_center/views/message_popup_collection.h" | 41 #include "ui/message_center/views/message_popup_collection.h" |
| 41 #include "ui/strings/grit/ui_strings.h" | 42 #include "ui/strings/grit/ui_strings.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 std::unique_ptr<TrayBubbleWrapper> bubble_wrapper_; | 118 std::unique_ptr<TrayBubbleWrapper> bubble_wrapper_; |
| 118 | 119 |
| 119 DISALLOW_COPY_AND_ASSIGN(WebNotificationBubbleWrapper); | 120 DISALLOW_COPY_AND_ASSIGN(WebNotificationBubbleWrapper); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 class WebNotificationItem : public views::View, public gfx::AnimationDelegate { | 123 class WebNotificationItem : public views::View, public gfx::AnimationDelegate { |
| 123 public: | 124 public: |
| 124 WebNotificationItem(gfx::AnimationContainer* container, | 125 WebNotificationItem(gfx::AnimationContainer* container, |
| 125 WebNotificationTray* tray) | 126 WebNotificationTray* tray) |
| 126 : tray_(tray) { | 127 : tray_(tray) { |
| 127 SetPaintToLayer(true); | 128 SetPaintToLayer(ui::LAYER_TEXTURED); |
| 128 layer()->SetFillsBoundsOpaquely(false); | 129 layer()->SetFillsBoundsOpaquely(false); |
| 129 views::View::SetVisible(false); | 130 views::View::SetVisible(false); |
| 130 set_owned_by_client(); | 131 set_owned_by_client(); |
| 131 | 132 |
| 132 SetLayoutManager(new views::FillLayout); | 133 SetLayoutManager(new views::FillLayout); |
| 133 | 134 |
| 134 animation_.reset(new gfx::SlideAnimation(this)); | 135 animation_.reset(new gfx::SlideAnimation(this)); |
| 135 animation_->SetContainer(container); | 136 animation_->SetContainer(container); |
| 136 animation_->SetSlideDuration(kTrayItemAnimationDurationMS); | 137 animation_->SetSlideDuration(kTrayItemAnimationDurationMS); |
| 137 animation_->SetTweenType(gfx::Tween::LINEAR); | 138 animation_->SetTweenType(gfx::Tween::LINEAR); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 668 |
| 668 message_center::MessageCenterBubble* | 669 message_center::MessageCenterBubble* |
| 669 WebNotificationTray::GetMessageCenterBubbleForTest() { | 670 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 670 if (!message_center_bubble()) | 671 if (!message_center_bubble()) |
| 671 return nullptr; | 672 return nullptr; |
| 672 return static_cast<message_center::MessageCenterBubble*>( | 673 return static_cast<message_center::MessageCenterBubble*>( |
| 673 message_center_bubble()->bubble()); | 674 message_center_bubble()->bubble()); |
| 674 } | 675 } |
| 675 | 676 |
| 676 } // namespace ash | 677 } // namespace ash |
| OLD | NEW |