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_AURA_WINDOW_PORT_H_ | 5 #ifndef UI_AURA_WINDOW_PORT_H_ |
6 #define UI_AURA_WINDOW_PORT_H_ | 6 #define UI_AURA_WINDOW_PORT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
| 13 #include "base/callback.h" |
13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "cc/surfaces/surface_id.h" |
15 #include "ui/aura/aura_export.h" | 17 #include "ui/aura/aura_export.h" |
16 #include "ui/base/class_property.h" | 18 #include "ui/base/class_property.h" |
17 | 19 |
| 20 namespace cc { |
| 21 class CompositorFrameSink; |
| 22 } |
| 23 |
18 namespace gfx { | 24 namespace gfx { |
19 class Rect; | 25 class Rect; |
20 } | 26 } |
21 | 27 |
22 namespace aura { | 28 namespace aura { |
23 | 29 |
24 class Window; | 30 class Window; |
25 class WindowObserver; | 31 class WindowObserver; |
26 | 32 |
27 // WindowPort defines an interface to enable Window to be used with or without | 33 // WindowPort defines an interface to enable Window to be used with or without |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // calls. | 69 // calls. |
64 virtual std::unique_ptr<ui::PropertyData> OnWillChangeProperty( | 70 virtual std::unique_ptr<ui::PropertyData> OnWillChangeProperty( |
65 const void* key) = 0; | 71 const void* key) = 0; |
66 | 72 |
67 // Called after a property changes, but before observers are notified. |data| | 73 // Called after a property changes, but before observers are notified. |data| |
68 // is the return value from OnWillChangeProperty(). | 74 // is the return value from OnWillChangeProperty(). |
69 virtual void OnPropertyChanged(const void* key, | 75 virtual void OnPropertyChanged(const void* key, |
70 int64_t old_value, | 76 int64_t old_value, |
71 std::unique_ptr<ui::PropertyData> data) = 0; | 77 std::unique_ptr<ui::PropertyData> data) = 0; |
72 | 78 |
| 79 // Called for creating a cc::CompositorFrameSink for the window. |
| 80 virtual std::unique_ptr<cc::CompositorFrameSink> |
| 81 CreateCompositorFrameSink() = 0; |
| 82 |
| 83 // Get the current cc::SurfaceId. |
| 84 virtual cc::SurfaceId GetSurfaceId() const = 0; |
| 85 |
| 86 virtual void OnWindowAddedToRootWindow() = 0; |
| 87 virtual void OnWillRemoveWindowFromRootWindow() = 0; |
| 88 |
73 protected: | 89 protected: |
74 // Returns the WindowPort associated with a Window. | 90 // Returns the WindowPort associated with a Window. |
75 static WindowPort* Get(Window* window); | 91 static WindowPort* Get(Window* window); |
76 | 92 |
77 // Returns the ObserverList of a Window. | 93 // Returns the ObserverList of a Window. |
78 static base::ObserverList<WindowObserver, true>* GetObservers(Window* window); | 94 static base::ObserverList<WindowObserver, true>* GetObservers(Window* window); |
79 }; | 95 }; |
80 | 96 |
81 } // namespace aura | 97 } // namespace aura |
82 | 98 |
83 #endif // UI_AURA_WINDOW_PORT_H_ | 99 #endif // UI_AURA_WINDOW_PORT_H_ |
OLD | NEW |