OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ | 5 #ifndef UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ |
6 #define UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ | 6 #define UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace aura { | 26 namespace aura { |
27 namespace client { | 27 namespace client { |
28 class DefaultCaptureClient; | 28 class DefaultCaptureClient; |
29 class ScreenPositionClient; | 29 class ScreenPositionClient; |
30 class WindowTreeClient; | 30 class WindowTreeClient; |
31 } | 31 } |
32 class Window; | 32 class Window; |
33 } | 33 } |
34 | 34 |
35 namespace ui { | 35 namespace ui { |
36 class BitmapUploader; | |
37 class Window; | 36 class Window; |
38 class WindowTreeClient; | 37 class WindowTreeClient; |
39 namespace mojom { | 38 namespace mojom { |
40 enum class Cursor; | 39 enum class Cursor; |
41 enum class EventResult; | 40 enum class EventResult; |
42 } | 41 } |
43 } | 42 } |
44 | 43 |
45 namespace shell { | |
46 class Connector; | |
47 } | |
48 | |
49 namespace ui { | 44 namespace ui { |
50 class Event; | 45 class Event; |
51 class ViewProp; | |
52 } | 46 } |
53 | 47 |
54 namespace wm { | 48 namespace wm { |
55 class CursorManager; | 49 class CursorManager; |
56 class FocusController; | 50 class FocusController; |
57 } | 51 } |
58 | 52 |
59 namespace views { | 53 namespace views { |
60 class SurfaceContextFactory; | 54 class SurfaceContextFactory; |
61 class WidgetDelegate; | 55 class WidgetDelegate; |
62 | 56 |
63 // An implementation of NativeWidget that binds to a ui::Window. Because Aura | 57 // An implementation of NativeWidget that binds to a ui::Window. Because Aura |
64 // is used extensively within Views code, this code uses aura and binds to the | 58 // is used extensively within Views code, this code uses aura and binds to the |
65 // ui::Window via a Mus-specific aura::WindowTreeHost impl. Because the root | 59 // ui::Window via a Mus-specific aura::WindowTreeHost impl. Because the root |
66 // aura::Window in a hierarchy is created without a delegate by the | 60 // aura::Window in a hierarchy is created without a delegate by the |
67 // aura::WindowTreeHost, we must create a child aura::Window in this class | 61 // aura::WindowTreeHost, we must create a child aura::Window in this class |
68 // (content_) and attach it to the root. | 62 // (content_) and attach it to the root. |
69 class VIEWS_MUS_EXPORT NativeWidgetMus | 63 class VIEWS_MUS_EXPORT NativeWidgetMus |
70 : public internal::NativeWidgetPrivate, | 64 : public internal::NativeWidgetPrivate, |
71 public aura::WindowDelegate, | 65 public aura::WindowDelegate, |
72 public aura::WindowTreeHostObserver, | 66 public aura::WindowTreeHostObserver, |
73 public NON_EXPORTED_BASE(ui::InputEventHandler) { | 67 public NON_EXPORTED_BASE(ui::InputEventHandler) { |
74 public: | 68 public: |
75 NativeWidgetMus(internal::NativeWidgetDelegate* delegate, | 69 NativeWidgetMus(internal::NativeWidgetDelegate* delegate, |
76 shell::Connector* connector, | |
77 ui::Window* window, | 70 ui::Window* window, |
78 ui::mojom::SurfaceType surface_type); | 71 ui::mojom::SurfaceType surface_type); |
79 ~NativeWidgetMus() override; | 72 ~NativeWidgetMus() override; |
80 | 73 |
81 // Configures the set of properties supplied to the window manager when | 74 // Configures the set of properties supplied to the window manager when |
82 // creating a new Window for a Widget. | 75 // creating a new Window for a Widget. |
83 static void ConfigurePropertiesForNewWindow( | 76 static void ConfigurePropertiesForNewWindow( |
84 const Widget::InitParams& init_params, | 77 const Widget::InitParams& init_params, |
85 std::map<std::string, std::vector<uint8_t>>* properties); | 78 std::map<std::string, std::vector<uint8_t>>* properties); |
86 | 79 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // Aura configuration. | 266 // Aura configuration. |
274 std::unique_ptr<SurfaceContextFactory> context_factory_; | 267 std::unique_ptr<SurfaceContextFactory> context_factory_; |
275 std::unique_ptr<WindowTreeHostMus> window_tree_host_; | 268 std::unique_ptr<WindowTreeHostMus> window_tree_host_; |
276 aura::Window* content_; | 269 aura::Window* content_; |
277 std::unique_ptr<wm::FocusController> focus_client_; | 270 std::unique_ptr<wm::FocusController> focus_client_; |
278 std::unique_ptr<MusCaptureClient> capture_client_; | 271 std::unique_ptr<MusCaptureClient> capture_client_; |
279 std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_; | 272 std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_; |
280 std::unique_ptr<aura::client::ScreenPositionClient> screen_position_client_; | 273 std::unique_ptr<aura::client::ScreenPositionClient> screen_position_client_; |
281 std::unique_ptr<wm::CursorManager> cursor_manager_; | 274 std::unique_ptr<wm::CursorManager> cursor_manager_; |
282 | 275 |
283 // Bitmap management. | |
284 std::unique_ptr<ui::BitmapUploader> bitmap_uploader_; | |
285 std::unique_ptr<ui::ViewProp> prop_; | |
286 | |
287 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; | 276 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; |
288 | 277 |
289 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); | 278 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); |
290 }; | 279 }; |
291 | 280 |
292 } // namespace views | 281 } // namespace views |
293 | 282 |
294 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ | 283 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ |
OLD | NEW |