| 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_POSITIONER_H_ | 5 #ifndef ASH_WM_WINDOW_POSITIONER_H_ |
| 6 #define ASH_WM_WINDOW_POSITIONER_H_ | 6 #define ASH_WM_WINDOW_POSITIONER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 WindowPositioner(); | 78 WindowPositioner(); |
| 79 ~WindowPositioner(); | 79 ~WindowPositioner(); |
| 80 | 80 |
| 81 // Find a suitable screen position for a popup window and return it. The | 81 // Find a suitable screen position for a popup window and return it. The |
| 82 // passed input position is only used to retrieve the width and height. | 82 // passed input position is only used to retrieve the width and height. |
| 83 // The position is determined on the left / right / top / bottom first. If | 83 // The position is determined on the left / right / top / bottom first. If |
| 84 // no smart space is found, the position will follow the standard what other | 84 // no smart space is found, the position will follow the standard what other |
| 85 // operating systems do (default cascading style). | 85 // operating systems do (default cascading style). |
| 86 gfx::Rect GetPopupPosition(const gfx::Rect& old_pos); | 86 gfx::Rect GetPopupPosition(const gfx::Rect& old_pos); |
| 87 | 87 |
| 88 // Accessor to set a flag indicating whether the first window in ASH should |
| 89 // be maximized. |
| 90 static void SetMaximizeFirstWindow(bool maximize); |
| 91 |
| 88 protected: | 92 protected: |
| 89 friend class test::WindowPositionerTest; | 93 friend class test::WindowPositionerTest; |
| 90 | 94 |
| 91 // Find a smart way to position the popup window. If there is no space this | 95 // Find a smart way to position the popup window. If there is no space this |
| 92 // function will return an empty rectangle. | 96 // function will return an empty rectangle. |
| 93 gfx::Rect SmartPopupPosition(const gfx::Rect& old_pos, | 97 gfx::Rect SmartPopupPosition(const gfx::Rect& old_pos, |
| 94 const gfx::Rect& work_area, | 98 const gfx::Rect& work_area, |
| 95 int grid); | 99 int grid); |
| 96 | 100 |
| 97 // Find the next available cascading popup position (on the given screen). | 101 // Find the next available cascading popup position (on the given screen). |
| (...skipping 20 matching lines...) Expand all Loading... |
| 118 // The last used position. | 122 // The last used position. |
| 119 int last_popup_position_x_; | 123 int last_popup_position_x_; |
| 120 int last_popup_position_y_; | 124 int last_popup_position_y_; |
| 121 | 125 |
| 122 DISALLOW_COPY_AND_ASSIGN(WindowPositioner); | 126 DISALLOW_COPY_AND_ASSIGN(WindowPositioner); |
| 123 }; | 127 }; |
| 124 | 128 |
| 125 } // namespace ash | 129 } // namespace ash |
| 126 | 130 |
| 127 #endif // ASH_WM_WINDOW_POSITIONER_H_ | 131 #endif // ASH_WM_WINDOW_POSITIONER_H_ |
| OLD | NEW |