OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WINDOW_STATE_H_ | 5 #ifndef ASH_WM_WINDOW_STATE_H_ |
6 #define ASH_WM_WINDOW_STATE_H_ | 6 #define ASH_WM_WINDOW_STATE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/wm/wm_types.h" | 9 #include "ash/wm/wm_types.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Predicates to check window state. | 62 // Predicates to check window state. |
63 bool IsMinimized() const; | 63 bool IsMinimized() const; |
64 bool IsMaximized() const; | 64 bool IsMaximized() const; |
65 bool IsFullscreen() const; | 65 bool IsFullscreen() const; |
66 bool IsMaximizedOrFullscreen() const; | 66 bool IsMaximizedOrFullscreen() const; |
67 // True if the window's show state is SHOW_STATE_NORMAL or | 67 // True if the window's show state is SHOW_STATE_NORMAL or |
68 // SHOW_STATE_DEFAULT. | 68 // SHOW_STATE_DEFAULT. |
69 bool IsNormalShowState() const; | 69 bool IsNormalShowState() const; |
70 bool IsActive() const; | 70 bool IsActive() const; |
71 bool IsDocked() const; | 71 bool IsDocked() const; |
| 72 bool IsSnapped() const; |
72 | 73 |
73 // Checks if the window can change its state accordingly. | 74 // Checks if the window can change its state accordingly. |
74 bool CanMaximize() const; | 75 bool CanMaximize() const; |
75 bool CanMinimize() const; | 76 bool CanMinimize() const; |
76 bool CanResize() const; | 77 bool CanResize() const; |
77 bool CanSnap() const; | 78 bool CanSnap() const; |
78 bool CanActivate() const; | 79 bool CanActivate() const; |
79 | 80 |
80 // Returns true if the window has restore bounds. | 81 // Returns true if the window has restore bounds. |
81 bool HasRestoreBounds() const; | 82 bool HasRestoreBounds() const; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 182 |
182 // Whether or not the window's position can be managed by the | 183 // Whether or not the window's position can be managed by the |
183 // auto management logic. | 184 // auto management logic. |
184 bool window_position_managed() const { return window_position_managed_; } | 185 bool window_position_managed() const { return window_position_managed_; } |
185 void set_window_position_managed(bool window_position_managed) { | 186 void set_window_position_managed(bool window_position_managed) { |
186 window_position_managed_ = window_position_managed; | 187 window_position_managed_ = window_position_managed; |
187 } | 188 } |
188 | 189 |
189 // Whether or not the window's position or size was changed by a user. | 190 // Whether or not the window's position or size was changed by a user. |
190 bool bounds_changed_by_user() const { return bounds_changed_by_user_; } | 191 bool bounds_changed_by_user() const { return bounds_changed_by_user_; } |
191 void set_bounds_changed_by_user(bool bounds_changed_by_user) { | 192 |
192 bounds_changed_by_user_ = bounds_changed_by_user; | 193 // Sets |bounds_changed_by_user_| to the value passed in a parameter. |
193 } | 194 // If the new value is true allows the window to be repositioned away from |
| 195 // snapped state at the screen edge. |
| 196 void SetBoundsChangedByUser(bool bounds_changed_by_user); |
194 | 197 |
195 // True if this window is an attached panel. | 198 // True if this window is an attached panel. |
196 bool panel_attached() const { | 199 bool panel_attached() const { |
197 return panel_attached_; | 200 return panel_attached_; |
198 } | 201 } |
199 void set_panel_attached(bool panel_attached) { | 202 void set_panel_attached(bool panel_attached) { |
200 panel_attached_ = panel_attached; | 203 panel_attached_ = panel_attached; |
201 } | 204 } |
202 | 205 |
203 // Indicates that an in progress drag should be continued after the | 206 // Indicates that an in progress drag should be continued after the |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 virtual void OnWindowPropertyChanged(aura::Window* window, | 253 virtual void OnWindowPropertyChanged(aura::Window* window, |
251 const void* key, | 254 const void* key, |
252 intptr_t old) OVERRIDE; | 255 intptr_t old) OVERRIDE; |
253 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 256 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
254 | 257 |
255 private: | 258 private: |
256 // Snaps the window to left or right of the desktop with given bounds. | 259 // Snaps the window to left or right of the desktop with given bounds. |
257 void SnapWindow(WindowShowType left_or_right, | 260 void SnapWindow(WindowShowType left_or_right, |
258 const gfx::Rect& bounds); | 261 const gfx::Rect& bounds); |
259 | 262 |
| 263 // Allows window to be repositioned away from the screen edge. |
| 264 void SetWindowShowTypeUnsnapped(); |
| 265 |
260 // The owner of this window settings. | 266 // The owner of this window settings. |
261 aura::Window* window_; | 267 aura::Window* window_; |
262 scoped_ptr<WindowStateDelegate> delegate_; | 268 scoped_ptr<WindowStateDelegate> delegate_; |
263 | 269 |
264 bool tracked_by_workspace_; | 270 bool tracked_by_workspace_; |
265 bool window_position_managed_; | 271 bool window_position_managed_; |
266 bool bounds_changed_by_user_; | 272 bool bounds_changed_by_user_; |
267 bool panel_attached_; | 273 bool panel_attached_; |
268 bool continue_drag_after_reparent_; | 274 bool continue_drag_after_reparent_; |
269 bool ignored_by_shelf_; | 275 bool ignored_by_shelf_; |
(...skipping 27 matching lines...) Expand all Loading... |
297 ASH_EXPORT WindowState* GetWindowState(aura::Window* window); | 303 ASH_EXPORT WindowState* GetWindowState(aura::Window* window); |
298 | 304 |
299 // const version of GetWindowState. | 305 // const version of GetWindowState. |
300 ASH_EXPORT const WindowState* | 306 ASH_EXPORT const WindowState* |
301 GetWindowState(const aura::Window* window); | 307 GetWindowState(const aura::Window* window); |
302 | 308 |
303 } // namespace wm | 309 } // namespace wm |
304 } // namespace ash | 310 } // namespace ash |
305 | 311 |
306 #endif // ASH_WM_WINDOW_STATE_H_ | 312 #endif // ASH_WM_WINDOW_STATE_H_ |
OLD | NEW |