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

Side by Side Diff: services/ui/ws/display.h

Issue 2712963003: mustash: Use ui::chromeos::EventRewriter in mus (Closed)
Patch Set: Fix build issues. Created 3 years, 9 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 | « services/ui/ws/cursor_unittest.cc ('k') | services/ui/ws/display.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 SERVICES_UI_WS_DISPLAY_H_ 5 #ifndef SERVICES_UI_WS_DISPLAY_H_
6 #define SERVICES_UI_WS_DISPLAY_H_ 6 #define SERVICES_UI_WS_DISPLAY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 10 matching lines...) Expand all
21 #include "services/ui/ws/focus_controller_delegate.h" 21 #include "services/ui/ws/focus_controller_delegate.h"
22 #include "services/ui/ws/focus_controller_observer.h" 22 #include "services/ui/ws/focus_controller_observer.h"
23 #include "services/ui/ws/platform_display.h" 23 #include "services/ui/ws/platform_display.h"
24 #include "services/ui/ws/platform_display_delegate.h" 24 #include "services/ui/ws/platform_display_delegate.h"
25 #include "services/ui/ws/server_window.h" 25 #include "services/ui/ws/server_window.h"
26 #include "services/ui/ws/server_window_observer.h" 26 #include "services/ui/ws/server_window_observer.h"
27 #include "services/ui/ws/server_window_tracker.h" 27 #include "services/ui/ws/server_window_tracker.h"
28 #include "services/ui/ws/user_id_tracker_observer.h" 28 #include "services/ui/ws/user_id_tracker_observer.h"
29 #include "services/ui/ws/window_manager_window_tree_factory_set_observer.h" 29 #include "services/ui/ws/window_manager_window_tree_factory_set_observer.h"
30 #include "ui/display/display.h" 30 #include "ui/display/display.h"
31 #include "ui/events/event_sink.h"
31 32
32 namespace display { 33 namespace display {
33 struct ViewportMetrics; 34 struct ViewportMetrics;
34 } 35 }
35 36
36 namespace ui { 37 namespace ui {
37 namespace ws { 38 namespace ws {
38 39
39 class DisplayBinding; 40 class DisplayBinding;
40 class DisplayManager; 41 class DisplayManager;
(...skipping 13 matching lines...) Expand all
54 // . with a DisplayBinding. In this mode there is only ever one WindowManager 55 // . with a DisplayBinding. In this mode there is only ever one WindowManager
55 // for the display, which comes from the client that created the 56 // for the display, which comes from the client that created the
56 // Display. 57 // Display.
57 // . without a DisplayBinding. In this mode a WindowManager is automatically 58 // . without a DisplayBinding. In this mode a WindowManager is automatically
58 // created per user. 59 // created per user.
59 class Display : public PlatformDisplayDelegate, 60 class Display : public PlatformDisplayDelegate,
60 public mojom::WindowTreeHost, 61 public mojom::WindowTreeHost,
61 public FocusControllerObserver, 62 public FocusControllerObserver,
62 public FocusControllerDelegate, 63 public FocusControllerDelegate,
63 public UserIdTrackerObserver, 64 public UserIdTrackerObserver,
64 public WindowManagerWindowTreeFactorySetObserver { 65 public WindowManagerWindowTreeFactorySetObserver,
66 public EventSink {
65 public: 67 public:
66 explicit Display(WindowServer* window_server); 68 explicit Display(WindowServer* window_server);
67 ~Display() override; 69 ~Display() override;
68 70
69 // Initializes the display root ServerWindow and PlatformDisplay. Adds this to 71 // Initializes the display root ServerWindow and PlatformDisplay. Adds this to
70 // DisplayManager as a pending display, until accelerated widget is available. 72 // DisplayManager as a pending display, until accelerated widget is available.
71 void Init(const display::ViewportMetrics& metrics, 73 void Init(const display::ViewportMetrics& metrics,
72 std::unique_ptr<DisplayBinding> binding); 74 std::unique_ptr<DisplayBinding> binding);
73 75
74 // Returns an ID for this display. In internal mode this the display::Display 76 // Returns an ID for this display. In internal mode this the display::Display
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 173
172 void CreateWindowManagerDisplayRootFromFactory( 174 void CreateWindowManagerDisplayRootFromFactory(
173 WindowManagerWindowTreeFactory* factory); 175 WindowManagerWindowTreeFactory* factory);
174 176
175 // Creates the root ServerWindow for this display, where |size| is in physical 177 // Creates the root ServerWindow for this display, where |size| is in physical
176 // pixels. 178 // pixels.
177 void CreateRootWindow(const gfx::Size& size); 179 void CreateRootWindow(const gfx::Size& size);
178 180
179 // PlatformDisplayDelegate: 181 // PlatformDisplayDelegate:
180 ServerWindow* GetRootWindow() override; 182 ServerWindow* GetRootWindow() override;
183 EventSink* GetEventSink() override;
181 void OnAcceleratedWidgetAvailable() override; 184 void OnAcceleratedWidgetAvailable() override;
182 void OnEvent(const ui::Event& event) override;
183 void OnNativeCaptureLost() override; 185 void OnNativeCaptureLost() override;
184 186
185 // FocusControllerDelegate: 187 // FocusControllerDelegate:
186 bool CanHaveActiveChildren(ServerWindow* window) const override; 188 bool CanHaveActiveChildren(ServerWindow* window) const override;
187 189
188 // FocusControllerObserver: 190 // FocusControllerObserver:
189 void OnActivationChanged(ServerWindow* old_active_window, 191 void OnActivationChanged(ServerWindow* old_active_window,
190 ServerWindow* new_active_window) override; 192 ServerWindow* new_active_window) override;
191 void OnFocusChanged(FocusControllerChangeSource change_source, 193 void OnFocusChanged(FocusControllerChangeSource change_source,
192 ServerWindow* old_focused_window, 194 ServerWindow* old_focused_window,
193 ServerWindow* new_focused_window) override; 195 ServerWindow* new_focused_window) override;
194 196
195 // UserIdTrackerObserver: 197 // UserIdTrackerObserver:
196 void OnUserIdRemoved(const UserId& id) override; 198 void OnUserIdRemoved(const UserId& id) override;
197 199
198 // WindowManagerWindowTreeFactorySetObserver: 200 // WindowManagerWindowTreeFactorySetObserver:
199 void OnWindowManagerWindowTreeFactoryReady( 201 void OnWindowManagerWindowTreeFactoryReady(
200 WindowManagerWindowTreeFactory* factory) override; 202 WindowManagerWindowTreeFactory* factory) override;
201 203
204 // EventSink:
205 EventDispatchDetails OnEventFromSource(Event* event) override;
206
202 std::unique_ptr<DisplayBinding> binding_; 207 std::unique_ptr<DisplayBinding> binding_;
203 WindowServer* const window_server_; 208 WindowServer* const window_server_;
204 std::unique_ptr<ServerWindow> root_; 209 std::unique_ptr<ServerWindow> root_;
205 std::unique_ptr<PlatformDisplay> platform_display_; 210 std::unique_ptr<PlatformDisplay> platform_display_;
206 std::unique_ptr<FocusController> focus_controller_; 211 std::unique_ptr<FocusController> focus_controller_;
207 212
208 // In internal window mode this contains information about the display. In 213 // In internal window mode this contains information about the display. In
209 // external window mode this will be invalid. 214 // external window mode this will be invalid.
210 display::Display display_; 215 display::Display display_;
211 216
212 // The last cursor set. Used to track whether we need to change the cursor. 217 // The last cursor set. Used to track whether we need to change the cursor.
213 mojom::Cursor last_cursor_; 218 mojom::Cursor last_cursor_;
214 219
215 ServerWindowTracker activation_parents_; 220 ServerWindowTracker activation_parents_;
216 221
217 cc::LocalSurfaceIdAllocator allocator_; 222 cc::LocalSurfaceIdAllocator allocator_;
218 223
219 WindowManagerDisplayRootMap window_manager_display_root_map_; 224 WindowManagerDisplayRootMap window_manager_display_root_map_;
220 225
221 DISALLOW_COPY_AND_ASSIGN(Display); 226 DISALLOW_COPY_AND_ASSIGN(Display);
222 }; 227 };
223 228
224 } // namespace ws 229 } // namespace ws
225 } // namespace ui 230 } // namespace ui
226 231
227 #endif // SERVICES_UI_WS_DISPLAY_H_ 232 #endif // SERVICES_UI_WS_DISPLAY_H_
OLDNEW
« no previous file with comments | « services/ui/ws/cursor_unittest.cc ('k') | services/ui/ws/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698