OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "mojo/public/cpp/bindings/array.h" | 14 #include "mojo/public/cpp/bindings/array.h" |
15 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 15 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
16 #include "services/ui/common/types.h" | 16 #include "services/ui/common/types.h" |
| 17 #include "services/ui/public/cpp/compositor_frame_sink.h" |
17 #include "services/ui/public/cpp/surface_id_handler.h" | 18 #include "services/ui/public/cpp/surface_id_handler.h" |
18 #include "services/ui/public/interfaces/mus_constants.mojom.h" | 19 #include "services/ui/public/interfaces/mus_constants.mojom.h" |
19 #include "services/ui/public/interfaces/window_tree.mojom.h" | 20 #include "services/ui/public/interfaces/window_tree.mojom.h" |
20 #include "ui/gfx/geometry/insets.h" | 21 #include "ui/gfx/geometry/insets.h" |
21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
22 | 23 |
23 namespace gfx { | 24 namespace gfx { |
24 class Size; | 25 class Size; |
25 } | 26 } |
26 | 27 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void SetOpacity(float opacity); | 108 void SetOpacity(float opacity); |
108 | 109 |
109 // Cursors | 110 // Cursors |
110 mojom::Cursor predefined_cursor() const { return cursor_id_; } | 111 mojom::Cursor predefined_cursor() const { return cursor_id_; } |
111 void SetPredefinedCursor(ui::mojom::Cursor cursor_id); | 112 void SetPredefinedCursor(ui::mojom::Cursor cursor_id); |
112 | 113 |
113 // A Window is drawn if the Window and all its ancestors are visible and the | 114 // A Window is drawn if the Window and all its ancestors are visible and the |
114 // Window is attached to the root. | 115 // Window is attached to the root. |
115 bool IsDrawn() const; | 116 bool IsDrawn() const; |
116 | 117 |
117 std::unique_ptr<WindowSurface> RequestSurface(mojom::SurfaceType type); | 118 std::unique_ptr<CompositorFrameSink> RequestCompositorFrameSink( |
| 119 mojom::SurfaceType type, |
| 120 scoped_refptr<cc::ContextProvider> context_provider); |
118 | 121 |
119 void AttachSurface(mojom::SurfaceType type, | 122 void AttachCompositorFrameSink( |
120 std::unique_ptr<WindowSurfaceBinding> surface_binding); | 123 mojom::SurfaceType type, |
| 124 std::unique_ptr<WindowSurfaceBinding> surface_binding); |
121 | 125 |
122 // The template-ized versions of the following methods rely on the presence | 126 // The template-ized versions of the following methods rely on the presence |
123 // of a mojo::TypeConverter<const std::vector<uint8_t>, T>. | 127 // of a mojo::TypeConverter<const std::vector<uint8_t>, T>. |
124 // Sets a shared property on the window which is sent to the window server and | 128 // Sets a shared property on the window which is sent to the window server and |
125 // shared with other clients that can view this window. | 129 // shared with other clients that can view this window. |
126 template <typename T> | 130 template <typename T> |
127 void SetSharedProperty(const std::string& name, const T& data); | 131 void SetSharedProperty(const std::string& name, const T& data); |
128 // Gets a shared property set on the window. The property must exist. Call | 132 // Gets a shared property set on the window. The property must exist. Call |
129 // HasSharedProperty() before calling. | 133 // HasSharedProperty() before calling. |
130 template <typename T> | 134 template <typename T> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 std::map<const void*, Value> prop_map_; | 406 std::map<const void*, Value> prop_map_; |
403 | 407 |
404 std::unique_ptr<SurfaceInfo> surface_info_; | 408 std::unique_ptr<SurfaceInfo> surface_info_; |
405 | 409 |
406 DISALLOW_COPY_AND_ASSIGN(Window); | 410 DISALLOW_COPY_AND_ASSIGN(Window); |
407 }; | 411 }; |
408 | 412 |
409 } // namespace ui | 413 } // namespace ui |
410 | 414 |
411 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 415 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
OLD | NEW |