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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual void EndMoveLoop() OVERRIDE; | 51 virtual void EndMoveLoop() OVERRIDE; |
52 | 52 |
53 // Overridden form ash::DisplayController::Observer: | 53 // Overridden form ash::DisplayController::Observer: |
54 virtual void OnDisplayConfigurationChanging() OVERRIDE; | 54 virtual void OnDisplayConfigurationChanging() OVERRIDE; |
55 | 55 |
56 private: | 56 private: |
57 class ScopedWindowResizer; | 57 class ScopedWindowResizer; |
58 | 58 |
59 enum DragCompletionStatus { | 59 enum DragCompletionStatus { |
60 DRAG_COMPLETE, | 60 DRAG_COMPLETE, |
61 DRAG_REVERT | 61 DRAG_REVERT, |
| 62 |
| 63 // To be used when WindowResizer::GetTarget() is destroyed. Neither |
| 64 // completes nor reverts the drag because both access the WindowResizer's |
| 65 // window. |
| 66 DRAG_RESIZER_WINDOW_DESTROYED |
62 }; | 67 }; |
63 | 68 |
64 // Attempts to start a drag if one is not already in progress. Returns true if | 69 // Attempts to start a drag if one is not already in progress. Returns true if |
65 // successful. | 70 // successful. |
66 bool AttemptToStartDrag(aura::Window* window, | 71 bool AttemptToStartDrag(aura::Window* window, |
67 const gfx::Point& point_in_parent, | 72 const gfx::Point& point_in_parent, |
68 int window_component, | 73 int window_component, |
69 aura::client::WindowMoveSource source); | 74 aura::client::WindowMoveSource source); |
70 | 75 |
71 // Finishes the drag. | 76 // Completes or reverts the drag if one is in progress. Returns true if a |
72 void CompleteDrag(DragCompletionStatus status); | 77 // drag was completed or reverted. |
| 78 bool CompleteDrag(DragCompletionStatus status); |
73 | 79 |
74 void HandleMousePressed(aura::Window* target, ui::MouseEvent* event); | 80 void HandleMousePressed(aura::Window* target, ui::MouseEvent* event); |
75 void HandleMouseReleased(aura::Window* target, ui::MouseEvent* event); | 81 void HandleMouseReleased(aura::Window* target, ui::MouseEvent* event); |
76 | 82 |
77 // Called during a drag to resize/position the window. | 83 // Called during a drag to resize/position the window. |
78 void HandleDrag(aura::Window* target, ui::LocatedEvent* event); | 84 void HandleDrag(aura::Window* target, ui::LocatedEvent* event); |
79 | 85 |
80 // Called during mouse moves to update window resize shadows. | 86 // Called during mouse moves to update window resize shadows. |
81 void HandleMouseMoved(aura::Window* target, ui::LocatedEvent* event); | 87 void HandleMouseMoved(aura::Window* target, ui::LocatedEvent* event); |
82 | 88 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Used to track if this object is deleted while running a nested message | 122 // Used to track if this object is deleted while running a nested message |
117 // loop. If non-null the destructor sets this to true. | 123 // loop. If non-null the destructor sets this to true. |
118 bool* destroyed_; | 124 bool* destroyed_; |
119 | 125 |
120 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler); | 126 DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler); |
121 }; | 127 }; |
122 | 128 |
123 } // namespace aura | 129 } // namespace aura |
124 | 130 |
125 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ | 131 #endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_ |
OLD | NEW |