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/callback.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "cc/surfaces/surface_id.h" | 16 #include "cc/surfaces/surface_id.h" |
17 #include "ui/aura/aura_export.h" | 17 #include "ui/aura/aura_export.h" |
18 #include "ui/base/class_property.h" | 18 #include "ui/base/class_property.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class CompositorFrameSink; | 21 class CompositorFrameSink; |
| 22 class ContextProvider; |
22 } | 23 } |
23 | 24 |
24 namespace gfx { | 25 namespace gfx { |
25 class Rect; | 26 class Rect; |
26 } | 27 } |
27 | 28 |
| 29 namespace gpu { |
| 30 class GpuMemoryBufferManager; |
| 31 } |
| 32 |
28 namespace aura { | 33 namespace aura { |
29 | 34 |
30 class Window; | 35 class Window; |
31 class WindowObserver; | 36 class WindowObserver; |
32 | 37 |
33 // WindowPort defines an interface to enable Window to be used with or without | 38 // WindowPort defines an interface to enable Window to be used with or without |
34 // mus. WindowPort is owned by Window and called at key points in Windows | 39 // mus. WindowPort is owned by Window and called at key points in Windows |
35 // lifetime that enable Window to be used in both environments. | 40 // lifetime that enable Window to be used in both environments. |
36 // | 41 // |
37 // If a Window is created without an explicit WindowPort then | 42 // If a Window is created without an explicit WindowPort then |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual std::unique_ptr<ui::PropertyData> OnWillChangeProperty( | 75 virtual std::unique_ptr<ui::PropertyData> OnWillChangeProperty( |
71 const void* key) = 0; | 76 const void* key) = 0; |
72 | 77 |
73 // Called after a property changes, but before observers are notified. |data| | 78 // Called after a property changes, but before observers are notified. |data| |
74 // is the return value from OnWillChangeProperty(). | 79 // is the return value from OnWillChangeProperty(). |
75 virtual void OnPropertyChanged(const void* key, | 80 virtual void OnPropertyChanged(const void* key, |
76 int64_t old_value, | 81 int64_t old_value, |
77 std::unique_ptr<ui::PropertyData> data) = 0; | 82 std::unique_ptr<ui::PropertyData> data) = 0; |
78 | 83 |
79 // Called for creating a cc::CompositorFrameSink for the window. | 84 // Called for creating a cc::CompositorFrameSink for the window. |
80 virtual std::unique_ptr<cc::CompositorFrameSink> | 85 virtual std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink( |
81 CreateCompositorFrameSink() = 0; | 86 scoped_refptr<cc::ContextProvider> context_provider, |
| 87 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) = 0; |
82 | 88 |
83 // Get the current cc::SurfaceId. | 89 // Get the current cc::SurfaceId. |
84 virtual cc::SurfaceId GetSurfaceId() const = 0; | 90 virtual cc::SurfaceId GetSurfaceId() const = 0; |
85 | 91 |
86 virtual void OnWindowAddedToRootWindow() = 0; | 92 virtual void OnWindowAddedToRootWindow() = 0; |
87 virtual void OnWillRemoveWindowFromRootWindow() = 0; | 93 virtual void OnWillRemoveWindowFromRootWindow() = 0; |
88 | 94 |
89 protected: | 95 protected: |
90 // Returns the WindowPort associated with a Window. | 96 // Returns the WindowPort associated with a Window. |
91 static WindowPort* Get(Window* window); | 97 static WindowPort* Get(Window* window); |
92 | 98 |
93 // Returns the ObserverList of a Window. | 99 // Returns the ObserverList of a Window. |
94 static base::ObserverList<WindowObserver, true>* GetObservers(Window* window); | 100 static base::ObserverList<WindowObserver, true>* GetObservers(Window* window); |
95 }; | 101 }; |
96 | 102 |
97 } // namespace aura | 103 } // namespace aura |
98 | 104 |
99 #endif // UI_AURA_WINDOW_PORT_H_ | 105 #endif // UI_AURA_WINDOW_PORT_H_ |
OLD | NEW |