| 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 ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ | 5 #ifndef ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ |
| 6 #define ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ | 6 #define ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/wm/wm_toplevel_window_event_handler.h" | 10 #include "ash/common/wm/wm_toplevel_window_event_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 namespace mus { | 26 namespace mus { |
| 27 | 27 |
| 28 class WmWindowMus; | 28 class WmWindowMus; |
| 29 | 29 |
| 30 // EventHandler attached to windows that may be dragged and/or resized. This | 30 // EventHandler attached to windows that may be dragged and/or resized. This |
| 31 // forwards to WmToplevelWindowEventHandler to handle the actual drag/resize. | 31 // forwards to WmToplevelWindowEventHandler to handle the actual drag/resize. |
| 32 class MoveEventHandler : public ui::EventHandler, public aura::WindowObserver { | 32 class MoveEventHandler : public ui::EventHandler, public aura::WindowObserver { |
| 33 public: | 33 public: |
| 34 MoveEventHandler(::ui::Window* mus_window, | 34 MoveEventHandler(ui::Window* mus_window, |
| 35 ::ui::WindowManagerClient* window_manager_client, | 35 ui::WindowManagerClient* window_manager_client, |
| 36 aura::Window* aura_window); | 36 aura::Window* aura_window); |
| 37 ~MoveEventHandler() override; | 37 ~MoveEventHandler() override; |
| 38 | 38 |
| 39 // Retrieves the MoveEventHandler for an existing WmWindow. | 39 // Retrieves the MoveEventHandler for an existing WmWindow. |
| 40 static MoveEventHandler* GetForWindow(WmWindow* wm_window); | 40 static MoveEventHandler* GetForWindow(WmWindow* wm_window); |
| 41 | 41 |
| 42 // Attempts to start a drag if one is not already in progress. This passes | 42 // Attempts to start a drag if one is not already in progress. This passes |
| 43 // the call to the underlying WmToplevelWindowEventHandler. After the drag | 43 // the call to the underlying WmToplevelWindowEventHandler. After the drag |
| 44 // completes, |end_closure| will be called to return whether the drag was | 44 // completes, |end_closure| will be called to return whether the drag was |
| 45 // successfully completed. | 45 // successfully completed. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 | 61 |
| 62 // Overridden from ui::EventHandler: | 62 // Overridden from ui::EventHandler: |
| 63 void OnMouseEvent(ui::MouseEvent* event) override; | 63 void OnMouseEvent(ui::MouseEvent* event) override; |
| 64 void OnGestureEvent(ui::GestureEvent* event) override; | 64 void OnGestureEvent(ui::GestureEvent* event) override; |
| 65 void OnCancelMode(ui::CancelModeEvent* event) override; | 65 void OnCancelMode(ui::CancelModeEvent* event) override; |
| 66 | 66 |
| 67 // Overridden from aura::WindowObserver: | 67 // Overridden from aura::WindowObserver: |
| 68 void OnWindowDestroying(aura::Window* window) override; | 68 void OnWindowDestroying(aura::Window* window) override; |
| 69 | 69 |
| 70 WmWindowMus* wm_window_; | 70 WmWindowMus* wm_window_; |
| 71 ::ui::WindowManagerClient* window_manager_client_; | 71 ui::WindowManagerClient* window_manager_client_; |
| 72 // The root window of the aura::Window supplied to the constructor. | 72 // The root window of the aura::Window supplied to the constructor. |
| 73 // MoveEventHandler is added as a pre-target handler (and observer) of this. | 73 // MoveEventHandler is added as a pre-target handler (and observer) of this. |
| 74 aura::Window* root_window_; | 74 aura::Window* root_window_; |
| 75 wm::WmToplevelWindowEventHandler toplevel_window_event_handler_; | 75 wm::WmToplevelWindowEventHandler toplevel_window_event_handler_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(MoveEventHandler); | 77 DISALLOW_COPY_AND_ASSIGN(MoveEventHandler); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace mus | 80 } // namespace mus |
| 81 } // namespace ash | 81 } // namespace ash |
| 82 | 82 |
| 83 #endif // ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ | 83 #endif // ASH_MUS_FRAME_MOVE_EVENT_HANDLER_H_ |
| OLD | NEW |