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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // aura::WindowObserver overrides: | 247 // aura::WindowObserver overrides: |
248 virtual void OnWindowPropertyChanged(aura::Window* window, | 248 virtual void OnWindowPropertyChanged(aura::Window* window, |
249 const void* key, | 249 const void* key, |
250 intptr_t old) OVERRIDE; | 250 intptr_t old) OVERRIDE; |
251 | 251 |
252 private: | 252 private: |
253 // Snaps the window to left or right of the desktop with given bounds. | 253 // Snaps the window to left or right of the desktop with given bounds. |
254 void SnapWindow(WindowShowType left_or_right, | 254 void SnapWindow(WindowShowType left_or_right, |
255 const gfx::Rect& bounds); | 255 const gfx::Rect& bounds); |
256 | 256 |
| 257 // Sets the window show type and updates the show state if necessary. |
| 258 void SetWindowShowType(WindowShowType new_window_show_type); |
| 259 |
257 // The owner of this window settings. | 260 // The owner of this window settings. |
258 aura::Window* window_; | 261 aura::Window* window_; |
259 scoped_ptr<WindowStateDelegate> delegate_; | 262 scoped_ptr<WindowStateDelegate> delegate_; |
260 | 263 |
261 bool window_position_managed_; | 264 bool window_position_managed_; |
262 bool bounds_changed_by_user_; | 265 bool bounds_changed_by_user_; |
263 bool panel_attached_; | 266 bool panel_attached_; |
264 bool continue_drag_after_reparent_; | 267 bool continue_drag_after_reparent_; |
265 bool ignored_by_shelf_; | 268 bool ignored_by_shelf_; |
266 bool can_consume_system_keys_; | 269 bool can_consume_system_keys_; |
267 bool top_row_keys_are_function_keys_; | 270 bool top_row_keys_are_function_keys_; |
268 WindowResizer* window_resizer_; | 271 WindowResizer* window_resizer_; |
269 | 272 |
270 bool always_restores_to_restore_bounds_; | 273 bool always_restores_to_restore_bounds_; |
271 bool hide_shelf_when_fullscreen_; | 274 bool hide_shelf_when_fullscreen_; |
272 bool animate_to_fullscreen_; | 275 bool animate_to_fullscreen_; |
273 bool minimum_visibility_; | 276 bool minimum_visibility_; |
274 | 277 |
275 // A property to remember the window position which was set before the | 278 // A property to remember the window position which was set before the |
276 // auto window position manager changed the window bounds, so that it can get | 279 // auto window position manager changed the window bounds, so that it can get |
277 // restored when only this one window gets shown. | 280 // restored when only this one window gets shown. |
278 scoped_ptr<gfx::Rect> pre_auto_manage_window_bounds_; | 281 scoped_ptr<gfx::Rect> pre_auto_manage_window_bounds_; |
279 | 282 |
280 ObserverList<WindowStateObserver> observer_list_; | 283 ObserverList<WindowStateObserver> observer_list_; |
281 | 284 |
| 285 // True when in SetWindowShowType(). This is used to avoid reentrance. |
| 286 bool in_set_window_show_type_; |
| 287 |
282 WindowShowType window_show_type_; | 288 WindowShowType window_show_type_; |
283 | 289 |
284 DISALLOW_COPY_AND_ASSIGN(WindowState); | 290 DISALLOW_COPY_AND_ASSIGN(WindowState); |
285 }; | 291 }; |
286 | 292 |
287 // Returns the WindowState for active window. Returns |NULL| | 293 // Returns the WindowState for active window. Returns |NULL| |
288 // if there is no active window. | 294 // if there is no active window. |
289 ASH_EXPORT WindowState* GetActiveWindowState(); | 295 ASH_EXPORT WindowState* GetActiveWindowState(); |
290 | 296 |
291 // Returns the WindowState for |window|. Creates WindowState | 297 // Returns the WindowState for |window|. Creates WindowState |
292 // if it didn't exist. The settings object is owned by |window|. | 298 // if it didn't exist. The settings object is owned by |window|. |
293 ASH_EXPORT WindowState* GetWindowState(aura::Window* window); | 299 ASH_EXPORT WindowState* GetWindowState(aura::Window* window); |
294 | 300 |
295 // const version of GetWindowState. | 301 // const version of GetWindowState. |
296 ASH_EXPORT const WindowState* | 302 ASH_EXPORT const WindowState* |
297 GetWindowState(const aura::Window* window); | 303 GetWindowState(const aura::Window* window); |
298 | 304 |
299 } // namespace wm | 305 } // namespace wm |
300 } // namespace ash | 306 } // namespace ash |
301 | 307 |
302 #endif // ASH_WM_WINDOW_STATE_H_ | 308 #endif // ASH_WM_WINDOW_STATE_H_ |
OLD | NEW |