Chromium Code Reviews| 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); |
|
xiyuan
2017/03/02 20:39:51
"explicit" is required for single arg constructor
yoshiki
2017/03/03 01:22:04
Done.
| |
| 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 ControlButton; | 46 class ControlButton; |
| 47 class EventForwarder; | 47 class EventForwarder; |
| 48 class SettingsButton; | 48 class SettingsButton; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 void OnWindowDestroying(aura::Window* window) override; | 80 void OnWindowDestroying(aura::Window* window) override; |
| 81 | 81 |
| 82 // ArcCustomNotificationItem::Observer | 82 // ArcCustomNotificationItem::Observer |
| 83 void OnItemDestroying() override; | 83 void OnItemDestroying() override; |
| 84 void OnItemUpdated() override; | 84 void OnItemUpdated() override; |
| 85 | 85 |
| 86 // ArcNotificationSurfaceManager::Observer: | 86 // ArcNotificationSurfaceManager::Observer: |
| 87 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; | 87 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; |
| 88 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; | 88 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; |
| 89 | 89 |
| 90 ArcCustomNotificationItem* item_ = nullptr; | 90 ArcCustomNotificationItem* item_; |
|
xiyuan
2017/03/02 20:39:51
nit: Why do we need to change this? It would be us
yoshiki
2017/03/03 01:22:04
Oops, you're right. Reverted.
| |
| 91 exo::NotificationSurface* surface_ = nullptr; | 91 exo::NotificationSurface* surface_ = nullptr; |
| 92 | 92 |
| 93 const std::string notification_key_; | 93 const std::string notification_key_; |
| 94 | 94 |
| 95 // A pre-target event handler to forward events on the surface to this view. | 95 // A pre-target event handler to forward events on the surface to this view. |
| 96 // Using a pre-target event handler instead of a target handler on the surface | 96 // Using a pre-target event handler instead of a target handler on the surface |
| 97 // window because it has descendant aura::Window and the events on them need | 97 // window because it has descendant aura::Window and the events on them need |
| 98 // to be handled as well. | 98 // to be handled as well. |
| 99 // TODO(xiyuan): Revisit after exo::Surface no longer has an aura::Window. | 99 // TODO(xiyuan): Revisit after exo::Surface no longer has an aura::Window. |
| 100 std::unique_ptr<EventForwarder> event_forwarder_; | 100 std::unique_ptr<EventForwarder> event_forwarder_; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 115 | 115 |
| 116 // Protects from call loops between Layout and OnWindowBoundsChanged. | 116 // Protects from call loops between Layout and OnWindowBoundsChanged. |
| 117 bool in_layout_ = false; | 117 bool in_layout_ = false; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); | 119 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace arc | 122 } // namespace arc |
| 123 | 123 |
| 124 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ | 124 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ |
| OLD | NEW |