| 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_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 5 #ifndef ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
| 6 #define ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 6 #define ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Hides the window after a delay. | 115 // Hides the window after a delay. |
| 116 void DelayedHide(); | 116 void DelayedHide(); |
| 117 | 117 |
| 118 // Shows the widget immediately. | 118 // Shows the widget immediately. |
| 119 void ShowNow(); | 119 void ShowNow(); |
| 120 | 120 |
| 121 // Returns true if the widget is showing. | 121 // Returns true if the widget is showing. |
| 122 bool IsShowing() const; | 122 bool IsShowing() const; |
| 123 | 123 |
| 124 // Initiates a resize. | 124 // Initiates a resize. |
| 125 void StartResize(const gfx::Point& screen_location); | 125 void StartResize(const gfx::Point& location_in_screen); |
| 126 | 126 |
| 127 // Resizes to the new location. | 127 // Resizes to the new location. |
| 128 void Resize(const gfx::Point& screen_location, int event_flags); | 128 void Resize(const gfx::Point& location_in_screen, int event_flags); |
| 129 | 129 |
| 130 // Completes the resize. | 130 // Completes the resize. |
| 131 void CompleteResize(int event_flags); | 131 void CompleteResize(int event_flags); |
| 132 | 132 |
| 133 // Cancels the resize. | 133 // Cancels the resize. |
| 134 void CancelResize(); | 134 void CancelResize(); |
| 135 | 135 |
| 136 // Returns the bounds for the resize widget. | 136 // Returns the bounds for the resize widget. |
| 137 gfx::Rect CalculateResizeWidgetBounds(const gfx::Point& location) const; | 137 gfx::Rect CalculateResizeWidgetBounds( |
| 138 const gfx::Point& location_in_parent) const; |
| 138 | 139 |
| 139 // Returns true if |screen_location| is over the resize windows (or the resize | 140 // Returns true if |location_in_screen| is over the resize windows |
| 140 // widget itself). | 141 // (or the resize widget itself). |
| 141 bool IsOverWindows(const gfx::Point& screen_location) const; | 142 bool IsOverWindows(const gfx::Point& location_in_screen) const; |
| 142 | 143 |
| 143 // Returns true if |screen_location| is over |window|. | 144 // Returns true if |location_in_screen| is over |window|. |
| 144 bool IsOverWindow(aura::Window* window, | 145 bool IsOverWindow(aura::Window* window, |
| 145 const gfx::Point& screen_location, | 146 const gfx::Point& location_in_screen, |
| 146 int component) const; | 147 int component) const; |
| 147 | 148 |
| 148 // Windows and direction to resize. | 149 // Windows and direction to resize. |
| 149 ResizeWindows windows_; | 150 ResizeWindows windows_; |
| 150 | 151 |
| 151 // Timer before hiding. | 152 // Timer before hiding. |
| 152 base::OneShotTimer<MultiWindowResizeController> hide_timer_; | 153 base::OneShotTimer<MultiWindowResizeController> hide_timer_; |
| 153 | 154 |
| 154 // Timer used before showing. | 155 // Timer used before showing. |
| 155 base::OneShotTimer<MultiWindowResizeController> show_timer_; | 156 base::OneShotTimer<MultiWindowResizeController> show_timer_; |
| 156 | 157 |
| 157 views::Widget* resize_widget_; | 158 views::Widget* resize_widget_; |
| 158 | 159 |
| 159 // If non-null we're in a resize loop. | 160 // If non-null we're in a resize loop. |
| 160 scoped_ptr<WorkspaceWindowResizer> window_resizer_; | 161 scoped_ptr<WorkspaceWindowResizer> window_resizer_; |
| 161 | 162 |
| 162 // Mouse coordinate passed to Show(). | 163 // Mouse coordinate passed to Show() in container's coodinates. |
| 163 gfx::Point show_location_; | 164 gfx::Point show_location_in_parent_; |
| 164 | 165 |
| 165 // Bounds the widget was last shown at. | 166 // Bounds the widget was last shown at in screen coordinates. |
| 166 gfx::Rect show_bounds_; | 167 gfx::Rect show_bounds_in_screen_; |
| 167 | 168 |
| 168 // Size of the grid. | 169 // Size of the grid. |
| 169 int grid_size_; | 170 int grid_size_; |
| 170 | 171 |
| 171 // Used to detect whether the mouse is over the windows. While | 172 // Used to detect whether the mouse is over the windows. While |
| 172 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls | 173 // |resize_widget_| is non-NULL (ie the widget is showing) we ignore calls |
| 173 // to Show(). | 174 // to Show(). |
| 174 scoped_ptr<views::MouseWatcher> mouse_watcher_; | 175 scoped_ptr<views::MouseWatcher> mouse_watcher_; |
| 175 | 176 |
| 176 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); | 177 DISALLOW_COPY_AND_ASSIGN(MultiWindowResizeController); |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace internal | 180 } // namespace internal |
| 180 } // namespace ash | 181 } // namespace ash |
| 181 | 182 |
| 182 #endif // ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ | 183 #endif // ASH_WM_WORKSPACE_MULTI_WINDOW_RESIZE_CONTROLLER_H_ |
| OLD | NEW |