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

Side by Side Diff: mojo/services/window_manager/window_manager_app.h

Issue 685013002: Refactors event dispatching of NativeViewport into its own interface (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 6 years, 1 month 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
OLDNEW
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 MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 5 #ifndef MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 6 #define MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "mojo/aura/window_tree_host_mojo.h" 12 #include "mojo/aura/window_tree_host_mojo.h"
13 #include "mojo/public/cpp/application/application_delegate.h" 13 #include "mojo/public/cpp/application/application_delegate.h"
14 #include "mojo/public/cpp/application/interface_factory_impl.h" 14 #include "mojo/public/cpp/application/interface_factory_impl.h"
15 #include "mojo/public/cpp/bindings/string.h" 15 #include "mojo/public/cpp/bindings/string.h"
16 #include "mojo/services/public/cpp/view_manager/types.h" 16 #include "mojo/services/public/cpp/view_manager/types.h"
17 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" 17 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h"
18 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" 18 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
19 #include "mojo/services/public/cpp/view_manager/view_observer.h" 19 #include "mojo/services/public/cpp/view_manager/view_observer.h"
20 #include "mojo/services/public/interfaces/window_manager/window_manager_internal .mojom.h"
21 #include "mojo/services/window_manager/native_viewport_event_dispatcher_impl.h"
20 #include "mojo/services/window_manager/window_manager_impl.h" 22 #include "mojo/services/window_manager/window_manager_impl.h"
21 #include "mojo/services/window_manager/window_manager_internal_service_impl.h"
22 #include "mojo/services/window_manager/window_manager_service2_impl.h" 23 #include "mojo/services/window_manager/window_manager_service2_impl.h"
23 #include "ui/aura/client/focus_change_observer.h" 24 #include "ui/aura/client/focus_change_observer.h"
24 #include "ui/events/event_handler.h" 25 #include "ui/events/event_handler.h"
25 #include "ui/wm/public/activation_change_observer.h" 26 #include "ui/wm/public/activation_change_observer.h"
26 27
27 namespace aura { 28 namespace aura {
28 namespace client { 29 namespace client {
29 class ActivationClient; 30 class ActivationClient;
30 class FocusClient; 31 class FocusClient;
31 } 32 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void ActivateWindow(Id view); 82 void ActivateWindow(Id view);
82 83
83 bool IsReady() const; 84 bool IsReady() const;
84 85
85 // A client of this object will use this accessor to gain access to the 86 // A client of this object will use this accessor to gain access to the
86 // aura::Window hierarchy and attach event handlers. 87 // aura::Window hierarchy and attach event handlers.
87 WindowTreeHostMojo* host() { return window_tree_host_.get(); } 88 WindowTreeHostMojo* host() { return window_tree_host_.get(); }
88 89
89 void InitFocus(wm::FocusRules* rules); 90 void InitFocus(wm::FocusRules* rules);
90 91
91 void set_window_manager_client(WindowManagerInternalClient* client) {
92 window_manager_client_ = client;
93 }
94
95 // WindowManagerImpl::Embed() forwards to this. If connected to ViewManager 92 // WindowManagerImpl::Embed() forwards to this. If connected to ViewManager
96 // then forwards to delegate, otherwise waits for connection to establish then 93 // then forwards to delegate, otherwise waits for connection to establish then
97 // forwards. 94 // forwards.
98 void Embed(const String& url, 95 void Embed(const String& url,
99 InterfaceRequest<ServiceProvider> service_provider); 96 InterfaceRequest<ServiceProvider> service_provider);
100 97
101 // Overridden from ApplicationDelegate: 98 // Overridden from ApplicationDelegate:
102 void Initialize(ApplicationImpl* impl) override; 99 void Initialize(ApplicationImpl* impl) override;
103 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; 100 bool ConfigureIncomingConnection(ApplicationConnection* connection) override;
104 101
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void LaunchViewManager(ApplicationImpl* app); 145 void LaunchViewManager(ApplicationImpl* app);
149 146
150 Shell* shell_; 147 Shell* shell_;
151 148
152 InterfaceFactoryImplWithContext<WindowManagerService2Impl, WindowManagerApp> 149 InterfaceFactoryImplWithContext<WindowManagerService2Impl, WindowManagerApp>
153 window_manager_service2_factory_; 150 window_manager_service2_factory_;
154 151
155 InterfaceFactoryImplWithContext<WindowManagerImpl, WindowManagerApp> 152 InterfaceFactoryImplWithContext<WindowManagerImpl, WindowManagerApp>
156 window_manager_factory_; 153 window_manager_factory_;
157 154
158 InterfaceFactoryImplWithContext<WindowManagerInternalServiceImpl, 155 InterfaceFactoryImplWithContext<NativeViewportEventDispatcherImpl,
159 WindowManagerApp> 156 WindowManagerApp>
160 window_manager_internal_service_factory_; 157 native_viewport_event_dispatcher_factory_;
161 158
162 ViewManagerDelegate* wrapped_view_manager_delegate_; 159 ViewManagerDelegate* wrapped_view_manager_delegate_;
163 WindowManagerDelegate* window_manager_delegate_; 160 WindowManagerDelegate* window_manager_delegate_;
164 161
165 ViewManager* view_manager_; 162 ViewManager* view_manager_;
166 scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_; 163 scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
167 View* root_; 164 View* root_;
168 165
169 scoped_ptr<AuraInit> aura_init_; 166 scoped_ptr<AuraInit> aura_init_;
170 scoped_ptr<WindowTreeHostMojo> window_tree_host_; 167 scoped_ptr<WindowTreeHostMojo> window_tree_host_;
171 168
172 scoped_ptr<wm::ScopedCaptureClient> capture_client_; 169 scoped_ptr<wm::ScopedCaptureClient> capture_client_;
173 scoped_ptr<aura::client::FocusClient> focus_client_; 170 scoped_ptr<aura::client::FocusClient> focus_client_;
174 aura::client::ActivationClient* activation_client_; 171 aura::client::ActivationClient* activation_client_;
175 172
176 Connections connections_; 173 Connections connections_;
177 ViewIdToWindowMap view_id_to_window_map_; 174 ViewIdToWindowMap view_id_to_window_map_;
178 175
179 scoped_ptr<DummyDelegate> dummy_delegate_; 176 scoped_ptr<DummyDelegate> dummy_delegate_;
180 177
181 WindowManagerInternalClient* window_manager_client_; 178 WindowManagerInternalClientPtr window_manager_client_;
182 179
183 ScopedVector<PendingEmbed> pending_embeds_; 180 ScopedVector<PendingEmbed> pending_embeds_;
184 181
185 scoped_ptr<ViewManagerClient> view_manager_client_; 182 scoped_ptr<ViewManagerClient> view_manager_client_;
186 183
187 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); 184 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp);
188 }; 185 };
189 186
190 } // namespace mojo 187 } // namespace mojo
191 188
192 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ 189 #endif // MOJO_SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698