Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: ui/views/mus/native_widget_mus.h

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/mus/aura_init.cc ('k') | ui/views/mus/native_widget_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 {
34 class Shell; 32 class Shell;
35 } 33 }
36 }
37 }
38 34
39 namespace mus { 35 namespace mus {
40 class Window; 36 class Window;
41 class WindowTreeConnection; 37 class WindowTreeConnection;
42 38
43 } 39 }
44 40
45 namespace wm { 41 namespace wm {
46 class FocusController; 42 class FocusController;
47 } 43 }
48 44
49 namespace views { 45 namespace views {
50 class SurfaceContextFactory; 46 class SurfaceContextFactory;
51 class WidgetDelegate; 47 class WidgetDelegate;
52 class WindowTreeHostMus; 48 class WindowTreeHostMus;
53 49
54 // An implementation of NativeWidget that binds to a mus::Window. Because Aura 50 // An implementation of NativeWidget that binds to a mus::Window. Because Aura
55 // is used extensively within Views code, this code uses aura and binds to the 51 // is used extensively within Views code, this code uses aura and binds to the
56 // mus::Window via a Mus-specific aura::WindowTreeHost impl. Because the root 52 // mus::Window via a Mus-specific aura::WindowTreeHost impl. Because the root
57 // aura::Window in a hierarchy is created without a delegate by the 53 // aura::Window in a hierarchy is created without a delegate by the
58 // aura::WindowTreeHost, we must create a child aura::Window in this class 54 // aura::WindowTreeHost, we must create a child aura::Window in this class
59 // (content_) and attach it to the root. 55 // (content_) and attach it to the root.
60 class VIEWS_MUS_EXPORT NativeWidgetMus : public internal::NativeWidgetPrivate, 56 class VIEWS_MUS_EXPORT NativeWidgetMus : public internal::NativeWidgetPrivate,
61 public aura::WindowDelegate, 57 public aura::WindowDelegate,
62 public aura::WindowTreeHostObserver { 58 public aura::WindowTreeHostObserver {
63 public: 59 public:
64 NativeWidgetMus(internal::NativeWidgetDelegate* delegate, 60 NativeWidgetMus(internal::NativeWidgetDelegate* delegate,
65 mojo::shell::mojom::Shell* shell, 61 mojo::Shell* shell,
66 mus::Window* window, 62 mus::Window* window,
67 mus::mojom::SurfaceType surface_type); 63 mus::mojom::SurfaceType surface_type);
68 ~NativeWidgetMus() override; 64 ~NativeWidgetMus() override;
69 65
70 // Configures the set of properties supplied to the window manager when 66 // Configures the set of properties supplied to the window manager when
71 // creating a new Window for a Widget. 67 // creating a new Window for a Widget.
72 static void ConfigurePropertiesForNewWindow( 68 static void ConfigurePropertiesForNewWindow(
73 const Widget::InitParams& init_params, 69 const Widget::InitParams& init_params,
74 std::map<std::string, std::vector<uint8_t>>* properties); 70 std::map<std::string, std::vector<uint8_t>>* properties);
75 71
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 void OnMouseEvent(ui::MouseEvent* event) override; 193 void OnMouseEvent(ui::MouseEvent* event) override;
198 void OnScrollEvent(ui::ScrollEvent* event) override; 194 void OnScrollEvent(ui::ScrollEvent* event) override;
199 void OnGestureEvent(ui::GestureEvent* event) override; 195 void OnGestureEvent(ui::GestureEvent* event) override;
200 196
201 // Overridden from aura::WindowTreeHostObserver: 197 // Overridden from aura::WindowTreeHostObserver:
202 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; 198 void OnHostCloseRequested(const aura::WindowTreeHost* host) override;
203 199
204 private: 200 private:
205 mus::Window* window_; 201 mus::Window* window_;
206 202
207 mojo::shell::mojom::Shell* shell_; 203 mojo::Shell* shell_;
208 204
209 internal::NativeWidgetDelegate* native_widget_delegate_; 205 internal::NativeWidgetDelegate* native_widget_delegate_;
210 206
211 const mus::mojom::SurfaceType surface_type_; 207 const mus::mojom::SurfaceType surface_type_;
212 ui::PlatformWindowState show_state_before_fullscreen_; 208 ui::PlatformWindowState show_state_before_fullscreen_;
213 209
214 // 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.
215 Widget::InitParams::Ownership ownership_; 211 Widget::InitParams::Ownership ownership_;
216 212
217 // Aura configuration. 213 // Aura configuration.
218 scoped_ptr<SurfaceContextFactory> context_factory_; 214 scoped_ptr<SurfaceContextFactory> context_factory_;
219 scoped_ptr<WindowTreeHostMus> window_tree_host_; 215 scoped_ptr<WindowTreeHostMus> window_tree_host_;
220 aura::Window* content_; 216 aura::Window* content_;
221 scoped_ptr<wm::FocusController> focus_client_; 217 scoped_ptr<wm::FocusController> focus_client_;
222 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; 218 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
223 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; 219 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
224 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_; 220 base::WeakPtrFactory<NativeWidgetMus> close_widget_factory_;
225 221
226 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus); 222 DISALLOW_COPY_AND_ASSIGN(NativeWidgetMus);
227 }; 223 };
228 224
229 } // namespace views 225 } // namespace views
230 226
231 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_ 227 #endif // UI_VIEWS_MUS_NATIVE_WIDGET_MUS_H_
OLDNEW
« no previous file with comments | « ui/views/mus/aura_init.cc ('k') | ui/views/mus/native_widget_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698