| 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 UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ | 5 #ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
| 6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ | 6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace arc { | 29 namespace arc { |
| 30 | 30 |
| 31 class ArcCustomNotificationView | 31 class ArcCustomNotificationView |
| 32 : public views::NativeViewHost, | 32 : public views::NativeViewHost, |
| 33 public views::ButtonListener, | 33 public views::ButtonListener, |
| 34 public aura::WindowObserver, | 34 public aura::WindowObserver, |
| 35 public ArcCustomNotificationItem::Observer, | 35 public ArcCustomNotificationItem::Observer, |
| 36 public ArcNotificationSurfaceManager::Observer { | 36 public ArcNotificationSurfaceManager::Observer { |
| 37 public: | 37 public: |
| 38 explicit ArcCustomNotificationView(ArcCustomNotificationItem* item); | 38 ArcCustomNotificationView(ArcCustomNotificationItem* item); |
| 39 ~ArcCustomNotificationView() override; | 39 ~ArcCustomNotificationView() override; |
| 40 | 40 |
| 41 std::unique_ptr<message_center::CustomNotificationContentViewDelegate> | 41 std::unique_ptr<message_center::CustomNotificationContentViewDelegate> |
| 42 CreateContentViewDelegate(); | 42 CreateContentViewDelegate(); |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 class ContentViewDelegate; | 45 class ContentViewDelegate; |
| 46 class CloseButton; | 46 class CloseButton; |
| 47 class EventForwarder; | 47 class EventForwarder; |
| 48 class SlideHelper; | 48 class SlideHelper; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 78 void OnWindowDestroying(aura::Window* window) override; | 78 void OnWindowDestroying(aura::Window* window) override; |
| 79 | 79 |
| 80 // ArcCustomNotificationItem::Observer | 80 // ArcCustomNotificationItem::Observer |
| 81 void OnItemDestroying() override; | 81 void OnItemDestroying() override; |
| 82 void OnItemUpdated() override; | 82 void OnItemUpdated() override; |
| 83 | 83 |
| 84 // ArcNotificationSurfaceManager::Observer: | 84 // ArcNotificationSurfaceManager::Observer: |
| 85 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; | 85 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; |
| 86 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; | 86 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; |
| 87 | 87 |
| 88 ArcCustomNotificationItem* item_ = nullptr; | 88 ArcCustomNotificationItem* item_; |
| 89 exo::NotificationSurface* surface_ = nullptr; | 89 exo::NotificationSurface* surface_ = nullptr; |
| 90 | 90 |
| 91 const std::string notification_key_; | 91 const std::string notification_key_; |
| 92 | 92 |
| 93 // A pre-target event handler to forward events on the surface to this view. | 93 // A pre-target event handler to forward events on the surface to this view. |
| 94 // Using a pre-target event handler instead of a target handler on the surface | 94 // Using a pre-target event handler instead of a target handler on the surface |
| 95 // window because it has descendant aura::Window and the events on them need | 95 // window because it has descendant aura::Window and the events on them need |
| 96 // to be handled as well. | 96 // to be handled as well. |
| 97 // TODO(xiyuan): Revisit after exo::Surface no longer has an aura::Window. | 97 // TODO(xiyuan): Revisit after exo::Surface no longer has an aura::Window. |
| 98 std::unique_ptr<EventForwarder> event_forwarder_; | 98 std::unique_ptr<EventForwarder> event_forwarder_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 | 111 |
| 112 // Protects from call loops between Layout and OnWindowBoundsChanged. | 112 // Protects from call loops between Layout and OnWindowBoundsChanged. |
| 113 bool in_layout_ = false; | 113 bool in_layout_ = false; |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); | 115 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace arc | 118 } // namespace arc |
| 119 | 119 |
| 120 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ | 120 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
| OLD | NEW |