| 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 COMPONENTS_MUS_WS_DISPLAY_H_ | 5 #ifndef COMPONENTS_MUS_WS_DISPLAY_H_ |
| 6 #define COMPONENTS_MUS_WS_DISPLAY_H_ | 6 #define COMPONENTS_MUS_WS_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "components/mus/ws/server_window_observer.h" | 25 #include "components/mus/ws/server_window_observer.h" |
| 26 #include "components/mus/ws/server_window_tracker.h" | 26 #include "components/mus/ws/server_window_tracker.h" |
| 27 #include "components/mus/ws/user_id_tracker_observer.h" | 27 #include "components/mus/ws/user_id_tracker_observer.h" |
| 28 #include "components/mus/ws/window_manager_factory_registry_observer.h" | 28 #include "components/mus/ws/window_manager_factory_registry_observer.h" |
| 29 | 29 |
| 30 namespace mus { | 30 namespace mus { |
| 31 namespace ws { | 31 namespace ws { |
| 32 | 32 |
| 33 class ConnectionManager; | 33 class ConnectionManager; |
| 34 class DisplayBinding; | 34 class DisplayBinding; |
| 35 class DisplayManager; |
| 35 class FocusController; | 36 class FocusController; |
| 36 class WindowManagerState; | 37 class WindowManagerState; |
| 37 class WindowTree; | 38 class WindowTree; |
| 38 | 39 |
| 39 namespace test { | 40 namespace test { |
| 40 class DisplayTestApi; | 41 class DisplayTestApi; |
| 41 } | 42 } |
| 42 | 43 |
| 43 // Displays manages the state associated with a single display. Display has a | 44 // Displays manages the state associated with a single display. Display has a |
| 44 // single root window whose children are the roots for a per-user | 45 // single root window whose children are the roots for a per-user |
| (...skipping 27 matching lines...) Expand all Loading... |
| 72 void Init(scoped_ptr<DisplayBinding> binding); | 73 void Init(scoped_ptr<DisplayBinding> binding); |
| 73 | 74 |
| 74 uint32_t id() const { return id_; } | 75 uint32_t id() const { return id_; } |
| 75 | 76 |
| 76 // TODO(sky): move to WMM. | 77 // TODO(sky): move to WMM. |
| 77 void SetFrameDecorationValues(mojom::FrameDecorationValuesPtr values); | 78 void SetFrameDecorationValues(mojom::FrameDecorationValuesPtr values); |
| 78 const mojom::FrameDecorationValues& frame_decoration_values() const { | 79 const mojom::FrameDecorationValues& frame_decoration_values() const { |
| 79 return *frame_decoration_values_; | 80 return *frame_decoration_values_; |
| 80 } | 81 } |
| 81 | 82 |
| 82 // Schedules a paint for the specified region in the coordinates of |window| | 83 // Schedules a paint for the specified region in the coordinates of |window|. |
| 83 // if the |window| is in this viewport. Returns whether |window| is in the | 84 void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds); |
| 84 // viewport. | |
| 85 bool SchedulePaintIfInViewport(const ServerWindow* window, | |
| 86 const gfx::Rect& bounds); | |
| 87 | 85 |
| 88 // Schedules destruction of surfaces in |window|. If a frame has been | 86 // Schedules destruction of surfaces in |window|. If a frame has been |
| 89 // scheduled but not drawn surface destruction is delayed until the frame is | 87 // scheduled but not drawn surface destruction is delayed until the frame is |
| 90 // drawn, otherwise destruction is immediate. | 88 // drawn, otherwise destruction is immediate. |
| 91 void ScheduleSurfaceDestruction(ServerWindow* window); | 89 void ScheduleSurfaceDestruction(ServerWindow* window); |
| 92 | 90 |
| 93 // Returns the metrics for this viewport. | 91 // Returns the metrics for this viewport. |
| 94 const mojom::ViewportMetrics& GetViewportMetrics() const; | 92 const mojom::ViewportMetrics& GetViewportMetrics() const; |
| 95 | 93 |
| 96 mojom::Rotation GetRotation() const; | 94 mojom::Rotation GetRotation() const; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void SetImeVisibility(ServerWindow* window, bool visible); | 127 void SetImeVisibility(ServerWindow* window, bool visible); |
| 130 | 128 |
| 131 // Returns the window that has captured input. | 129 // Returns the window that has captured input. |
| 132 ServerWindow* GetCaptureWindow() { | 130 ServerWindow* GetCaptureWindow() { |
| 133 return event_dispatcher_.capture_window(); | 131 return event_dispatcher_.capture_window(); |
| 134 } | 132 } |
| 135 const ServerWindow* GetCaptureWindow() const { | 133 const ServerWindow* GetCaptureWindow() const { |
| 136 return event_dispatcher_.capture_window(); | 134 return event_dispatcher_.capture_window(); |
| 137 } | 135 } |
| 138 | 136 |
| 139 // Called just before |tree| is destroyed after its connection encounters an | 137 // Called just before |tree| is destroyed. |
| 140 // error. | 138 void OnWillDestroyTree(WindowTree* tree); |
| 141 void OnWindowTreeConnectionError(WindowTree* tree); | |
| 142 | 139 |
| 143 // Called when a client updates a cursor. This will update the cursor on the | 140 // Called when a client updates a cursor. This will update the cursor on the |
| 144 // native display if the cursor is currently under |window|. | 141 // native display if the cursor is currently under |window|. |
| 145 void OnCursorUpdated(ServerWindow* window); | 142 void OnCursorUpdated(ServerWindow* window); |
| 146 | 143 |
| 147 // Called when the window tree when stacking and bounds of a window | 144 // Called when the window tree when stacking and bounds of a window |
| 148 // change. This may update the cursor if the ServerWindow under the last | 145 // change. This may update the cursor if the ServerWindow under the last |
| 149 // known pointer location changed. | 146 // known pointer location changed. |
| 150 void MaybeChangeCursorOnWindowTreeChange(); | 147 void MaybeChangeCursorOnWindowTreeChange(); |
| 151 | 148 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 174 QueuedEvent(); | 171 QueuedEvent(); |
| 175 ~QueuedEvent(); | 172 ~QueuedEvent(); |
| 176 | 173 |
| 177 scoped_ptr<ui::Event> event; | 174 scoped_ptr<ui::Event> event; |
| 178 scoped_ptr<ProcessedEventTarget> processed_target; | 175 scoped_ptr<ProcessedEventTarget> processed_target; |
| 179 }; | 176 }; |
| 180 | 177 |
| 181 // Inits the necessary state once the display is ready. | 178 // Inits the necessary state once the display is ready. |
| 182 void InitWindowManagersIfNecessary(); | 179 void InitWindowManagersIfNecessary(); |
| 183 | 180 |
| 181 DisplayManager* display_manager(); |
| 182 const DisplayManager* display_manager() const; |
| 183 |
| 184 void OnEventAckTimeout(); | 184 void OnEventAckTimeout(); |
| 185 | 185 |
| 186 // Schedules an event to be processed later. | 186 // Schedules an event to be processed later. |
| 187 void QueueEvent(const ui::Event& event, | 187 void QueueEvent(const ui::Event& event, |
| 188 scoped_ptr<ProcessedEventTarget> processed_event_target); | 188 scoped_ptr<ProcessedEventTarget> processed_event_target); |
| 189 | 189 |
| 190 // Processes the next valid event in |event_queue_|. If the event has already | 190 // Processes the next valid event in |event_queue_|. If the event has already |
| 191 // been processed it is dispatched, otherwise the event is passed to the | 191 // been processed it is dispatched, otherwise the event is passed to the |
| 192 // EventDispatcher for processing. | 192 // EventDispatcher for processing. |
| 193 void ProcessNextEventFromQueue(); | 193 void ProcessNextEventFromQueue(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 mojom::FrameDecorationValuesPtr frame_decoration_values_; | 277 mojom::FrameDecorationValuesPtr frame_decoration_values_; |
| 278 | 278 |
| 279 DISALLOW_COPY_AND_ASSIGN(Display); | 279 DISALLOW_COPY_AND_ASSIGN(Display); |
| 280 }; | 280 }; |
| 281 | 281 |
| 282 } // namespace ws | 282 } // namespace ws |
| 283 } // namespace mus | 283 } // namespace mus |
| 284 | 284 |
| 285 #endif // COMPONENTS_MUS_WS_DISPLAY_H_ | 285 #endif // COMPONENTS_MUS_WS_DISPLAY_H_ |
| OLD | NEW |