Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ | 5 #ifndef ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ |
| 6 #define ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ | 6 #define ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 namespace ash { | 28 namespace ash { |
| 29 | 29 |
| 30 class WindowResizer; | 30 class WindowResizer; |
| 31 | 31 |
| 32 class ASH_EXPORT ToplevelWindowEventHandler | 32 class ASH_EXPORT ToplevelWindowEventHandler |
| 33 : public ui::EventHandler, | 33 : public ui::EventHandler, |
| 34 public aura::client::WindowMoveClient, | 34 public aura::client::WindowMoveClient, |
| 35 public DisplayController::Observer { | 35 public DisplayController::Observer { |
| 36 public: | 36 public: |
| 37 explicit ToplevelWindowEventHandler(aura::Window* owner); | 37 explicit ToplevelWindowEventHandler(); |
|
varkha
2013/12/13 04:05:14
Do we still need "explicit"?
| |
| 38 virtual ~ToplevelWindowEventHandler(); | 38 virtual ~ToplevelWindowEventHandler(); |
| 39 | 39 |
| 40 const aura::Window* owner() const { return owner_; } | |
| 41 | |
| 42 // Overridden from ui::EventHandler: | 40 // Overridden from ui::EventHandler: |
| 43 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | 41 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; |
| 44 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 42 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
| 45 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 43 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 46 | 44 |
| 47 // Overridden form aura::client::WindowMoveClient: | 45 // Overridden form aura::client::WindowMoveClient: |
| 48 virtual aura::client::WindowMoveResult RunMoveLoop( | 46 virtual aura::client::WindowMoveResult RunMoveLoop( |
| 49 aura::Window* source, | 47 aura::Window* source, |
| 50 const gfx::Vector2d& drag_offset, | 48 const gfx::Vector2d& drag_offset, |
| 51 aura::client::WindowMoveSource move_source) OVERRIDE; | 49 aura::client::WindowMoveSource move_source) OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 81 // Return value is returned by OnMouseEvent() above. | 79 // Return value is returned by OnMouseEvent() above. |
| 82 void HandleMouseMoved(aura::Window* target, ui::LocatedEvent* event); | 80 void HandleMouseMoved(aura::Window* target, ui::LocatedEvent* event); |
| 83 | 81 |
| 84 // Called for mouse exits to hide window resize shadows. | 82 // Called for mouse exits to hide window resize shadows. |
| 85 // Return value is returned by OnMouseEvent() above. | 83 // Return value is returned by OnMouseEvent() above. |
| 86 void HandleMouseExited(aura::Window* target, ui::LocatedEvent* event); | 84 void HandleMouseExited(aura::Window* target, ui::LocatedEvent* event); |
| 87 | 85 |
| 88 // Invoked from ScopedWindowResizer if the window is destroyed. | 86 // Invoked from ScopedWindowResizer if the window is destroyed. |
| 89 void ResizerWindowDestroyed(); | 87 void ResizerWindowDestroyed(); |
| 90 | 88 |
| 91 // The container which this event handler is handling events on. | |
| 92 aura::Window* owner_; | |
| 93 | |
| 94 // Are we running a nested message loop from RunMoveLoop(). | 89 // Are we running a nested message loop from RunMoveLoop(). |
| 95 bool in_move_loop_; | 90 bool in_move_loop_; |
| 96 | 91 |
| 97 // Was the move operation cancelled? Used only when the nested loop | 92 // Was the move operation cancelled? Used only when the nested loop |
| 98 // is used to move a window. | 93 // is used to move a window. |
| 99 bool move_cancelled_; | 94 bool move_cancelled_; |
| 100 | 95 |
| 101 // Is a window move/resize in progress because of gesture events? | 96 // Is a window move/resize in progress because of gesture events? |
| 102 bool in_gesture_drag_; | 97 bool in_gesture_drag_; |
| 103 | 98 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 114 // Used to track if this object is deleted while running a nested message | 109 // Used to track if this object is deleted while running a nested message |
| 115 // loop. If non-null the destructor sets this to true. | 110 // loop. If non-null the destructor sets this to true. |
| 116 bool* destroyed_; | 111 bool* destroyed_; |
| 117 | 112 |
| 118 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler); | 113 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler); |
| 119 }; | 114 }; |
| 120 | 115 |
| 121 } // namespace aura | 116 } // namespace aura |
| 122 | 117 |
| 123 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ | 118 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ |
| OLD | NEW |