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 COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ | 5 #ifndef COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
6 #define COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ | 6 #define COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "components/exo/surface_delegate.h" | 12 #include "components/exo/surface_delegate.h" |
hidehiko
2017/03/02 15:38:16
Unused?
| |
13 #include "components/exo/surface_observer.h" | 13 #include "components/exo/surface_observer.h" |
hidehiko
2017/03/02 15:38:15
Ditto.
| |
14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 class Window; | 17 class Window; |
18 } | 18 } |
19 | 19 |
20 namespace views { | |
21 class NativeViewHost; | |
22 } | |
23 | |
20 namespace exo { | 24 namespace exo { |
21 class NotificationSurfaceManager; | |
22 class Surface; | |
23 | 25 |
24 // Handles notification surface role of a given surface. | 26 // Handles notification surface role of a given surface. |
25 class NotificationSurface : public SurfaceDelegate, public SurfaceObserver { | 27 class NotificationSurface { |
26 public: | 28 public: |
27 NotificationSurface(NotificationSurfaceManager* manager, | 29 virtual ~NotificationSurface() {} |
hidehiko
2017/03/02 15:38:16
How about; s/{}/= default;/
| |
28 Surface* surface, | |
29 const std::string& notification_id); | |
30 ~NotificationSurface() override; | |
31 | 30 |
32 gfx::Size GetSize() const; | 31 virtual gfx::Size GetSize() const = 0; |
hidehiko
2017/03/02 15:38:15
Because this is now interface, could you document
| |
33 | 32 |
34 aura::Window* window() { return window_.get(); } | 33 virtual void AttachWindow(views::NativeViewHost* nvh) = 0; |
35 const std::string& notification_id() const { return notification_id_; } | |
36 | 34 |
37 // Overridden from SurfaceDelegate: | 35 virtual aura::Window* window() = 0; |
hidehiko
2017/03/02 15:38:16
Optional: These are now virtual function so it can
| |
38 void OnSurfaceCommit() override; | 36 virtual const std::string& notification_id() const = 0; |
39 bool IsSurfaceSynchronized() const override; | |
40 | |
41 // Overridden from SurfaceObserver: | |
42 void OnSurfaceDestroying(Surface* surface) override; | |
43 | |
44 private: | |
45 NotificationSurfaceManager* const manager_; // Not owned. | |
46 Surface* surface_; // Not owned. | |
47 const std::string notification_id_; | |
48 | |
49 std::unique_ptr<aura::Window> window_; | |
50 bool added_to_manager_ = false; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(NotificationSurface); | |
53 }; | 37 }; |
54 | 38 |
55 } // namespace exo | 39 } // namespace exo |
56 | 40 |
57 #endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ | 41 #endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
OLD | NEW |