| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TOAST_TOAST_OVERLAY_H_ |
| 6 #define ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_ | 6 #define ASH_COMMON_SYSTEM_TOAST_TOAST_OVERLAY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
| 9 | 10 |
| 10 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 11 #include "ui/compositor/layer_animation_observer.h" | 12 #include "ui/compositor/layer_animation_observer.h" |
| 12 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
| 13 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
| 14 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/views/view.h" | |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Rect; | 18 class Rect; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace views { | 21 namespace views { |
| 22 class Widget; | 22 class Widget; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 | 46 |
| 47 // Shows or hides the overlay. | 47 // Shows or hides the overlay. |
| 48 void Show(bool visible); | 48 void Show(bool visible); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend class ToastManagerTest; | 51 friend class ToastManagerTest; |
| 52 | 52 |
| 53 // Returns the current bounds of the overlay, which is based on visibility. | 53 // Returns the current bounds of the overlay, which is based on visibility. |
| 54 gfx::Rect CalculateOverlayBounds(); | 54 gfx::Rect CalculateOverlayBounds(); |
| 55 | 55 |
| 56 // ui::ImplicitAnimationObserver: |
| 56 void OnImplicitAnimationsScheduled() override; | 57 void OnImplicitAnimationsScheduled() override; |
| 57 void OnImplicitAnimationsCompleted() override; | 58 void OnImplicitAnimationsCompleted() override; |
| 58 | 59 |
| 59 views::Widget* widget_for_testing(); | 60 views::Widget* widget_for_testing(); |
| 60 void ClickDismissButtonForTesting(const ui::Event& event); | 61 void ClickDismissButtonForTesting(const ui::Event& event); |
| 61 | 62 |
| 62 Delegate* const delegate_; | 63 Delegate* const delegate_; |
| 63 const std::string text_; | 64 const std::string text_; |
| 64 const std::string dismiss_text_; | 65 const std::string dismiss_text_; |
| 65 std::unique_ptr<views::Widget> overlay_widget_; | 66 std::unique_ptr<views::Widget> overlay_widget_; |
| 66 std::unique_ptr<ToastOverlayView> overlay_view_; | 67 std::unique_ptr<ToastOverlayView> overlay_view_; |
| 67 gfx::Size widget_size_; | 68 gfx::Size widget_size_; |
| 68 | 69 |
| 69 DISALLOW_COPY_AND_ASSIGN(ToastOverlay); | 70 DISALLOW_COPY_AND_ASSIGN(ToastOverlay); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace ash | 73 } // namespace ash |
| 73 | 74 |
| 74 #endif // ASH_SYSTEM_TOAST_TOAST_OVERLAY_H_ | 75 #endif // ASH_COMMON_SYSTEM_TOAST_TOAST_OVERLAY_H_ |
| OLD | NEW |