| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MANAGER_STATE_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // not be exposed. | 89 // not be exposed. |
| 90 EventDispatcher* event_dispatcher() { return &event_dispatcher_; } | 90 EventDispatcher* event_dispatcher() { return &event_dispatcher_; } |
| 91 | 91 |
| 92 void Activate(const gfx::Point& mouse_location_on_screen); | 92 void Activate(const gfx::Point& mouse_location_on_screen); |
| 93 void Deactivate(); | 93 void Deactivate(); |
| 94 | 94 |
| 95 // Processes an event from PlatformDisplay. | 95 // Processes an event from PlatformDisplay. |
| 96 void ProcessEvent(const ui::Event& event); | 96 void ProcessEvent(const ui::Event& event); |
| 97 | 97 |
| 98 // Called when the ack from an event dispatched to WindowTree |tree| is | 98 // Called when the ack from an event dispatched to WindowTree |tree| is |
| 99 // received. When |handled| is true, the client consumed the event. | 99 // received. |
| 100 // TODO(sky): make this private and use a callback. | 100 // TODO(sky): make this private and use a callback. |
| 101 void OnEventAck(mojom::WindowTree* tree, bool handled); | 101 void OnEventAck(mojom::WindowTree* tree, mojom::EventResult result); |
| 102 | 102 |
| 103 // Returns a mojom::Display for the specified display. WindowManager specific | 103 // Returns a mojom::Display for the specified display. WindowManager specific |
| 104 // values are not set. | 104 // values are not set. |
| 105 mojom::DisplayPtr ToMojomDisplay() const; | 105 mojom::DisplayPtr ToMojomDisplay() const; |
| 106 | 106 |
| 107 void OnWillDestroyTree(WindowTree* tree); | 107 void OnWillDestroyTree(WindowTree* tree); |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 class ProcessedEventTarget; | 110 class ProcessedEventTarget; |
| 111 friend class Display; | 111 friend class Display; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 142 scoped_ptr<ProcessedEventTarget> processed_event_target); | 142 scoped_ptr<ProcessedEventTarget> processed_event_target); |
| 143 | 143 |
| 144 // Processes the next valid event in |event_queue_|. If the event has already | 144 // Processes the next valid event in |event_queue_|. If the event has already |
| 145 // been processed it is dispatched, otherwise the event is passed to the | 145 // been processed it is dispatched, otherwise the event is passed to the |
| 146 // EventDispatcher for processing. | 146 // EventDispatcher for processing. |
| 147 void ProcessNextEventFromQueue(); | 147 void ProcessNextEventFromQueue(); |
| 148 | 148 |
| 149 // Dispatches the event to the appropriate client and starts the ack timer. | 149 // Dispatches the event to the appropriate client and starts the ack timer. |
| 150 void DispatchInputEventToWindowImpl(ServerWindow* target, | 150 void DispatchInputEventToWindowImpl(ServerWindow* target, |
| 151 bool in_nonclient_area, | 151 bool in_nonclient_area, |
| 152 const ui::Event& event, | 152 const ui::Event& transformed_event, |
| 153 base::WeakPtr<Accelerator> accelerator); | 153 base::WeakPtr<Accelerator> accelerator); |
| 154 | 154 |
| 155 // EventDispatcherDelegate: | 155 // EventDispatcherDelegate: |
| 156 void OnAccelerator(uint32_t accelerator_id, const ui::Event& event) override; | 156 void OnAccelerator(uint32_t accelerator_id, const ui::Event& event) override; |
| 157 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; | 157 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; |
| 158 ServerWindow* GetFocusedWindowForEventDispatcher() override; | 158 ServerWindow* GetFocusedWindowForEventDispatcher() override; |
| 159 void SetNativeCapture() override; | 159 void SetNativeCapture() override; |
| 160 void ReleaseNativeCapture() override; | 160 void ReleaseNativeCapture() override; |
| 161 void OnServerWindowCaptureLost(ServerWindow* window) override; | 161 void OnServerWindowCaptureLost(ServerWindow* window) override; |
| 162 void DispatchInputEventToWindow(ServerWindow* target, | 162 void DispatchInputEventToWindow(ServerWindow* target, |
| 163 bool in_nonclient_area, | 163 bool in_nonclient_area, |
| 164 const ui::Event& event, | 164 const ui::Event& transformed_event, |
| 165 Accelerator* accelerator) override; | 165 Accelerator* accelerator) override; |
| 166 | 166 |
| 167 Display* display_; | 167 Display* display_; |
| 168 PlatformDisplay* platform_display_; | 168 PlatformDisplay* platform_display_; |
| 169 // If this was created implicitly by a call | 169 // If this was created implicitly by a call |
| 170 // WindowTreeHostFactory::CreateWindowTreeHost(), then |is_user_id_valid_| | 170 // WindowTreeHostFactory::CreateWindowTreeHost(), then |is_user_id_valid_| |
| 171 // is false. | 171 // is false. |
| 172 const bool is_user_id_valid_; | 172 const bool is_user_id_valid_; |
| 173 const UserId user_id_; | 173 const UserId user_id_; |
| 174 // Root ServerWindow of this WindowManagerState. |root_| has a parent, the | 174 // Root ServerWindow of this WindowManagerState. |root_| has a parent, the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 188 | 188 |
| 189 EventDispatcher event_dispatcher_; | 189 EventDispatcher event_dispatcher_; |
| 190 | 190 |
| 191 DISALLOW_COPY_AND_ASSIGN(WindowManagerState); | 191 DISALLOW_COPY_AND_ASSIGN(WindowManagerState); |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 } // namespace ws | 194 } // namespace ws |
| 195 } // namespace mus | 195 } // namespace mus |
| 196 | 196 |
| 197 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ | 197 #endif // COMPONENTS_MUS_WS_WINDOW_MANAGER_STATE_H_ |
| OLD | NEW |