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

Side by Side Diff: components/mus/ws/window_tree_host_impl.h

Issue 1465143004: Converts focusmanager from delegate to observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years 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 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 COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "components/mus/common/types.h" 10 #include "components/mus/common/types.h"
11 #include "components/mus/public/interfaces/window_tree_host.mojom.h" 11 #include "components/mus/public/interfaces/window_tree_host.mojom.h"
12 #include "components/mus/ws/display_manager.h" 12 #include "components/mus/ws/display_manager.h"
13 #include "components/mus/ws/event_dispatcher.h" 13 #include "components/mus/ws/event_dispatcher.h"
14 #include "components/mus/ws/event_dispatcher_delegate.h" 14 #include "components/mus/ws/event_dispatcher_delegate.h"
15 #include "components/mus/ws/focus_controller_delegate.h" 15 #include "components/mus/ws/focus_controller_observer.h"
16 #include "components/mus/ws/server_window.h" 16 #include "components/mus/ws/server_window.h"
17 #include "components/mus/ws/server_window_observer.h" 17 #include "components/mus/ws/server_window_observer.h"
18 18
19 namespace mus { 19 namespace mus {
20 namespace ws { 20 namespace ws {
21 21
22 class ConnectionManager; 22 class ConnectionManager;
23 class FocusController; 23 class FocusController;
24 class WindowTreeHostDelegate; 24 class WindowTreeHostDelegate;
25 class WindowTreeImpl; 25 class WindowTreeImpl;
26 26
27 // WindowTreeHostImpl is an implementation of the WindowTreeHost interface. 27 // WindowTreeHostImpl is an implementation of the WindowTreeHost interface.
28 // It serves as a top level root window for a window. Its lifetime is managed by 28 // It serves as a top level root window for a window. Its lifetime is managed by
29 // ConnectionManager. If the connection to the client breaks or if the user 29 // ConnectionManager. If the connection to the client breaks or if the user
30 // closes the associated window, then this object and related state will be 30 // closes the associated window, then this object and related state will be
31 // deleted. 31 // deleted.
32 class WindowTreeHostImpl : public DisplayManagerDelegate, 32 class WindowTreeHostImpl : public DisplayManagerDelegate,
33 public mojom::WindowTreeHost, 33 public mojom::WindowTreeHost,
34 public FocusControllerDelegate, 34 public FocusControllerObserver,
35 public EventDispatcherDelegate, 35 public EventDispatcherDelegate,
36 public ServerWindowObserver { 36 public ServerWindowObserver {
37 public: 37 public:
38 // TODO(fsamuel): All these parameters are just plumbing for creating 38 // TODO(fsamuel): All these parameters are just plumbing for creating
39 // DisplayManagers. We should probably just store these common parameters 39 // DisplayManagers. We should probably just store these common parameters
40 // in the DisplayManagerFactory and pass them along on DisplayManager::Create. 40 // in the DisplayManagerFactory and pass them along on DisplayManager::Create.
41 WindowTreeHostImpl(mojom::WindowTreeHostClientPtr client, 41 WindowTreeHostImpl(mojom::WindowTreeHostClientPtr client,
42 ConnectionManager* connection_manager, 42 ConnectionManager* connection_manager,
43 mojo::ApplicationImpl* app_impl, 43 mojo::ApplicationImpl* app_impl,
44 const scoped_refptr<GpuState>& gpu_state, 44 const scoped_refptr<GpuState>& gpu_state,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // DisplayManagerDelegate: 101 // DisplayManagerDelegate:
102 ServerWindow* GetRootWindow() override; 102 ServerWindow* GetRootWindow() override;
103 void OnEvent(mojom::EventPtr event) override; 103 void OnEvent(mojom::EventPtr event) override;
104 void OnDisplayClosed() override; 104 void OnDisplayClosed() override;
105 void OnViewportMetricsChanged( 105 void OnViewportMetricsChanged(
106 const mojom::ViewportMetrics& old_metrics, 106 const mojom::ViewportMetrics& old_metrics,
107 const mojom::ViewportMetrics& new_metrics) override; 107 const mojom::ViewportMetrics& new_metrics) override;
108 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; 108 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override;
109 void OnCompositorFrameDrawn() override; 109 void OnCompositorFrameDrawn() override;
110 110
111 // FocusControllerDelegate: 111 // FocusControllerObserver:
112 void OnFocusChanged(ServerWindow* old_focused_window, 112 void OnFocusChanged(FocusControllerChangeSource change_source,
113 ServerWindow* old_focused_window,
113 ServerWindow* new_focused_window) override; 114 ServerWindow* new_focused_window) override;
114 115
115 // EventDispatcherDelegate: 116 // EventDispatcherDelegate:
116 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; 117 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override;
117 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; 118 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
118 ServerWindow* GetFocusedWindowForEventDispatcher() override; 119 ServerWindow* GetFocusedWindowForEventDispatcher() override;
119 void DispatchInputEventToWindow(ServerWindow* target, 120 void DispatchInputEventToWindow(ServerWindow* target,
120 bool in_nonclient_area, 121 bool in_nonclient_area,
121 mojom::EventPtr event) override; 122 mojom::EventPtr event) override;
122 123
(...skipping 13 matching lines...) Expand all
136 // draws. 137 // draws.
137 std::set<ServerWindow*> windows_needing_frame_destruction_; 138 std::set<ServerWindow*> windows_needing_frame_destruction_;
138 139
139 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); 140 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl);
140 }; 141 };
141 142
142 } // namespace ws 143 } // namespace ws
143 } // namespace mus 144 } // namespace mus
144 145
145 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ 146 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « components/mus/ws/focus_controller_unittest.cc ('k') | components/mus/ws/window_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698