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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "components/mus/public/interfaces/window_tree.mojom.h" | 16 #include "components/mus/public/interfaces/window_tree.mojom.h" |
17 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
18 #include "ui/aura/window_tree_host_observer.h" | 18 #include "ui/aura/window_tree_host_observer.h" |
19 #include "ui/platform_window/platform_window_delegate.h" | 19 #include "ui/platform_window/platform_window_delegate.h" |
20 #include "ui/views/mus/mus_export.h" | 20 #include "ui/views/mus/mus_export.h" |
21 #include "ui/views/widget/native_widget_private.h" | 21 #include "ui/views/widget/native_widget_private.h" |
22 | 22 |
23 namespace aura { | 23 namespace aura { |
24 namespace client { | 24 namespace client { |
25 class DefaultCaptureClient; | 25 class DefaultCaptureClient; |
26 class ScreenPositionClient; | |
27 class WindowTreeClient; | 26 class WindowTreeClient; |
28 } | 27 } |
29 class Window; | 28 class Window; |
30 } | 29 } |
31 | 30 |
32 namespace mojo { | 31 namespace mojo { |
33 class Shell; | 32 class Shell; |
34 } | 33 } |
35 | 34 |
36 namespace mus { | 35 namespace mus { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // creating a new Window for a Widget. | 67 // creating a new Window for a Widget. |
69 static void ConfigurePropertiesForNewWindow( | 68 static void ConfigurePropertiesForNewWindow( |
70 const Widget::InitParams& init_params, | 69 const Widget::InitParams& init_params, |
71 std::map<std::string, std::vector<uint8_t>>* properties); | 70 std::map<std::string, std::vector<uint8_t>>* properties); |
72 | 71 |
73 // Notifies all widgets the frame constants changed in some way. | 72 // Notifies all widgets the frame constants changed in some way. |
74 static void NotifyFrameChanged(mus::WindowTreeConnection* connection); | 73 static void NotifyFrameChanged(mus::WindowTreeConnection* connection); |
75 | 74 |
76 mus::Window* window() { return window_; } | 75 mus::Window* window() { return window_; } |
77 | 76 |
78 aura::Window* GetRootWindow(); | |
79 | |
80 void OnPlatformWindowClosed(); | 77 void OnPlatformWindowClosed(); |
81 void OnActivationChanged(bool active); | 78 void OnActivationChanged(bool active); |
82 | 79 |
83 protected: | 80 protected: |
84 // Updates the client area in the mus::Window. | 81 // Updates the client area in the mus::Window. |
85 virtual void UpdateClientArea(); | 82 virtual void UpdateClientArea(); |
86 | 83 |
87 // internal::NativeWidgetPrivate: | 84 // internal::NativeWidgetPrivate: |
88 NonClientFrameView* CreateNonClientFrameView() override; | 85 NonClientFrameView* CreateNonClientFrameView() override; |
89 void InitNativeWidget(const Widget::InitParams& params) override; | 86 void InitNativeWidget(const Widget::InitParams& params) override; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 void OnMouseEvent(ui::MouseEvent* event) override; | 193 void OnMouseEvent(ui::MouseEvent* event) override; |
197 void OnScrollEvent(ui::ScrollEvent* event) override; | 194 void OnScrollEvent(ui::ScrollEvent* event) override; |
198 void OnGestureEvent(ui::GestureEvent* event) override; | 195 void OnGestureEvent(ui::GestureEvent* event) override; |
199 | 196 |
200 // Overridden from aura::WindowTreeHostObserver: | 197 // Overridden from aura::WindowTreeHostObserver: |
201 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; | 198 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
202 | 199 |
203 private: | 200 private: |
204 mus::Window* window_; | 201 mus::Window* window_; |
205 | 202 |
| 203 mojo::Shell* shell_; |
| 204 |
206 internal::NativeWidgetDelegate* native_widget_delegate_; | 205 internal::NativeWidgetDelegate* native_widget_delegate_; |
207 | 206 |
208 const mus::mojom::SurfaceType surface_type_; | 207 const mus::mojom::SurfaceType surface_type_; |
209 ui::PlatformWindowState show_state_before_fullscreen_; | 208 ui::PlatformWindowState show_state_before_fullscreen_; |
210 | 209 |
211 // See class documentation for Widget in widget.h for a note about ownership. | 210 // See class documentation for Widget in widget.h for a note about ownership. |
212 Widget::InitParams::Ownership ownership_; | 211 Widget::InitParams::Ownership ownership_; |
213 | 212 |
214 // Aura configuration. | 213 // Aura configuration. |
215 scoped_ptr<SurfaceContextFactory> context_factory_; | 214 scoped_ptr<SurfaceContextFactory> context_factory_; |
216 scoped_ptr<WindowTreeHostMus> window_tree_host_; | 215 scoped_ptr<WindowTreeHostMus> window_tree_host_; |
217 aura::Window* content_; | 216 aura::Window* content_; |
218 scoped_ptr<wm::FocusController> focus_client_; | 217 scoped_ptr<wm::FocusController> focus_client_; |
219 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; | 218 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
220 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; | 219 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; |
221 scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_; | |
222 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; | 220 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; |
223 | 221 |
224 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); | 222 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); |
225 }; | 223 }; |
226 | 224 |
227 } // namespace views | 225 } // namespace views |
228 | 226 |
229 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ | 227 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ |
OLD | NEW |