| 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_WINDOW_UTIL_H_ | 5 #ifndef ASH_WM_WINDOW_UTIL_H_ |
| 6 #define ASH_WM_WINDOW_UTIL_H_ | 6 #define ASH_WM_WINDOW_UTIL_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // TODO(oshima): remove this. | 45 // TODO(oshima): remove this. |
| 46 ASH_EXPORT bool IsWindowMinimized(aura::Window* window); | 46 ASH_EXPORT bool IsWindowMinimized(aura::Window* window); |
| 47 | 47 |
| 48 // Returns true if |window|'s location can be controlled by the user. | 48 // Returns true if |window|'s location can be controlled by the user. |
| 49 ASH_EXPORT bool IsWindowUserPositionable(aura::Window* window); | 49 ASH_EXPORT bool IsWindowUserPositionable(aura::Window* window); |
| 50 | 50 |
| 51 // Moves the window to the center of the display. | 51 // Moves the window to the center of the display. |
| 52 ASH_EXPORT void CenterWindow(aura::Window* window); | 52 ASH_EXPORT void CenterWindow(aura::Window* window); |
| 53 | 53 |
| 54 ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( | |
| 55 wm::WmWindow* window); | |
| 56 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( | |
| 57 wm::WmWindow* window); | |
| 58 | |
| 59 // Returns the bounds of a left snapped window with default width in parent | |
| 60 // coordinates. | |
| 61 ASH_EXPORT gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent( | |
| 62 aura::Window* window); | |
| 63 | |
| 64 // Returns the bounds of a right snapped window with default width in parent | |
| 65 // coordinates. | |
| 66 ASH_EXPORT gfx::Rect GetDefaultRightSnappedWindowBoundsInParent( | |
| 67 aura::Window* window); | |
| 68 | |
| 69 // Moves |window| to the root window where the |event| occured if it is not | 54 // Moves |window| to the root window where the |event| occured if it is not |
| 70 // already in the same root window. Returns true if |window| was moved. | 55 // already in the same root window. Returns true if |window| was moved. |
| 71 ASH_EXPORT bool MoveWindowToEventRoot(aura::Window* window, | 56 ASH_EXPORT bool MoveWindowToEventRoot(aura::Window* window, |
| 72 const ui::Event& event); | 57 const ui::Event& event); |
| 73 | 58 |
| 74 // Changes the parent of a |child| and all its transient children that are | |
| 75 // themselves children of |old_parent| to |new_parent|. | |
| 76 void ReparentChildWithTransientChildren(aura::Window* child, | |
| 77 aura::Window* old_parent, | |
| 78 aura::Window* new_parent); | |
| 79 | |
| 80 // Changes the parent of all transient children of a |child| to |new_parent|. | |
| 81 // Does not change parent of the transient children that are not themselves | |
| 82 // children of |old_parent|. | |
| 83 void ReparentTransientChildrenOfChild(aura::Window* child, | |
| 84 aura::Window* old_parent, | |
| 85 aura::Window* new_parent); | |
| 86 | |
| 87 // Snap the window's layer to physical pixel boundary. | 59 // Snap the window's layer to physical pixel boundary. |
| 88 void SnapWindowToPixelBoundary(aura::Window* window); | 60 void SnapWindowToPixelBoundary(aura::Window* window); |
| 89 | 61 |
| 90 // Mark the container window so that InstallSnapLayoutManagerToContainers | 62 // Mark the container window so that InstallSnapLayoutManagerToContainers |
| 91 // installs the SnapToPixelLayoutManager. | 63 // installs the SnapToPixelLayoutManager. |
| 92 ASH_EXPORT void SetSnapsChildrenToPhysicalPixelBoundary( | 64 ASH_EXPORT void SetSnapsChildrenToPhysicalPixelBoundary( |
| 93 aura::Window* container); | 65 aura::Window* container); |
| 94 | 66 |
| 95 // Traverse the |container| tree and installs SnapToPixelLayoutManager. | 67 // Traverse the |container| tree and installs SnapToPixelLayoutManager. |
| 96 void InstallSnapLayoutManagerToContainers(aura::Window* container); | 68 void InstallSnapLayoutManagerToContainers(aura::Window* container); |
| 97 | 69 |
| 98 } // namespace wm | 70 } // namespace wm |
| 99 } // namespace ash | 71 } // namespace ash |
| 100 | 72 |
| 101 #endif // ASH_WM_WINDOW_UTIL_H_ | 73 #endif // ASH_WM_WINDOW_UTIL_H_ |
| OLD | NEW |