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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace aura { | 23 namespace aura { |
24 namespace client { | 24 namespace client { |
25 class DefaultCaptureClient; | 25 class DefaultCaptureClient; |
26 class WindowTreeClient; | 26 class WindowTreeClient; |
27 } | 27 } |
28 class Window; | 28 class Window; |
29 } | 29 } |
30 | 30 |
31 namespace mojo { | 31 namespace mojo { |
| 32 namespace shell { |
| 33 namespace mojom { |
32 class Shell; | 34 class Shell; |
33 } | 35 } |
| 36 } |
| 37 } |
34 | 38 |
35 namespace mus { | 39 namespace mus { |
36 class Window; | 40 class Window; |
37 class WindowTreeConnection; | 41 class WindowTreeConnection; |
38 | 42 |
39 } | 43 } |
40 | 44 |
41 namespace wm { | 45 namespace wm { |
42 class FocusController; | 46 class FocusController; |
43 } | 47 } |
44 | 48 |
45 namespace views { | 49 namespace views { |
46 class SurfaceContextFactory; | 50 class SurfaceContextFactory; |
47 class WidgetDelegate; | 51 class WidgetDelegate; |
48 class WindowTreeHostMus; | 52 class WindowTreeHostMus; |
49 | 53 |
50 // An implementation of NativeWidget that binds to a mus::Window. Because Aura | 54 // An implementation of NativeWidget that binds to a mus::Window. Because Aura |
51 // is used extensively within Views code, this code uses aura and binds to the | 55 // is used extensively within Views code, this code uses aura and binds to the |
52 // mus::Window via a Mus-specific aura::WindowTreeHost impl. Because the root | 56 // mus::Window via a Mus-specific aura::WindowTreeHost impl. Because the root |
53 // aura::Window in a hierarchy is created without a delegate by the | 57 // aura::Window in a hierarchy is created without a delegate by the |
54 // aura::WindowTreeHost, we must create a child aura::Window in this class | 58 // aura::WindowTreeHost, we must create a child aura::Window in this class |
55 // (content_) and attach it to the root. | 59 // (content_) and attach it to the root. |
56 class VIEWS_MUS_EXPORT NativeWidgetMus : public internal::NativeWidgetPrivate, | 60 class VIEWS_MUS_EXPORT NativeWidgetMus : public internal::NativeWidgetPrivate, |
57 public aura::WindowDelegate, | 61 public aura::WindowDelegate, |
58 public aura::WindowTreeHostObserver { | 62 public aura::WindowTreeHostObserver { |
59 public: | 63 public: |
60 NativeWidgetMus(internal::NativeWidgetDelegate* delegate, | 64 NativeWidgetMus(internal::NativeWidgetDelegate* delegate, |
61 mojo::Shell* shell, | 65 mojo::shell::mojom::Shell* shell, |
62 mus::Window* window, | 66 mus::Window* window, |
63 mus::mojom::SurfaceType surface_type); | 67 mus::mojom::SurfaceType surface_type); |
64 ~NativeWidgetMus() override; | 68 ~NativeWidgetMus() override; |
65 | 69 |
66 // Configures the set of properties supplied to the window manager when | 70 // Configures the set of properties supplied to the window manager when |
67 // creating a new Window for a Widget. | 71 // creating a new Window for a Widget. |
68 static void ConfigurePropertiesForNewWindow( | 72 static void ConfigurePropertiesForNewWindow( |
69 const Widget::InitParams& init_params, | 73 const Widget::InitParams& init_params, |
70 std::map<std::string, std::vector<uint8_t>>* properties); | 74 std::map<std::string, std::vector<uint8_t>>* properties); |
71 | 75 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 void OnMouseEvent(ui::MouseEvent* event) override; | 197 void OnMouseEvent(ui::MouseEvent* event) override; |
194 void OnScrollEvent(ui::ScrollEvent* event) override; | 198 void OnScrollEvent(ui::ScrollEvent* event) override; |
195 void OnGestureEvent(ui::GestureEvent* event) override; | 199 void OnGestureEvent(ui::GestureEvent* event) override; |
196 | 200 |
197 // Overridden from aura::WindowTreeHostObserver: | 201 // Overridden from aura::WindowTreeHostObserver: |
198 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; | 202 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
199 | 203 |
200 private: | 204 private: |
201 mus::Window* window_; | 205 mus::Window* window_; |
202 | 206 |
203 mojo::Shell* shell_; | 207 mojo::shell::mojom::Shell* shell_; |
204 | 208 |
205 internal::NativeWidgetDelegate* native_widget_delegate_; | 209 internal::NativeWidgetDelegate* native_widget_delegate_; |
206 | 210 |
207 const mus::mojom::SurfaceType surface_type_; | 211 const mus::mojom::SurfaceType surface_type_; |
208 ui::PlatformWindowState show_state_before_fullscreen_; | 212 ui::PlatformWindowState show_state_before_fullscreen_; |
209 | 213 |
210 // See class documentation for Widget in widget.h for a note about ownership. | 214 // See class documentation for Widget in widget.h for a note about ownership. |
211 Widget::InitParams::Ownership ownership_; | 215 Widget::InitParams::Ownership ownership_; |
212 | 216 |
213 // Aura configuration. | 217 // Aura configuration. |
214 scoped_ptr<SurfaceContextFactory> context_factory_; | 218 scoped_ptr<SurfaceContextFactory> context_factory_; |
215 scoped_ptr<WindowTreeHostMus> window_tree_host_; | 219 scoped_ptr<WindowTreeHostMus> window_tree_host_; |
216 aura::Window* content_; | 220 aura::Window* content_; |
217 scoped_ptr<wm::FocusController> focus_client_; | 221 scoped_ptr<wm::FocusController> focus_client_; |
218 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 222 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
219 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; | 223 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; |
220 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; | 224 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; |
221 | 225 |
222 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); | 226 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); |
223 }; | 227 }; |
224 | 228 |
225 } // namespace views | 229 } // namespace views |
226 | 230 |
227 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ | 231 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ |
OLD | NEW |