| 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_COMMON_WINDOW_POSITIONER_H_ |
| 6 #define ASH_WM_WINDOW_POSITIONER_H_ | 6 #define ASH_WM_COMMON_WINDOW_POSITIONER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Display; | 13 class Display; |
| 14 class Rect; | 14 class Rect; |
| 15 } | 15 } |
| 16 | 16 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // function will return an empty rectangle. | 96 // function will return an empty rectangle. |
| 97 gfx::Rect SmartPopupPosition(const gfx::Rect& old_pos, | 97 gfx::Rect SmartPopupPosition(const gfx::Rect& old_pos, |
| 98 const gfx::Rect& work_area, | 98 const gfx::Rect& work_area, |
| 99 int grid); | 99 int grid); |
| 100 | 100 |
| 101 // Find the next available cascading popup position (on the given screen). | 101 // Find the next available cascading popup position (on the given screen). |
| 102 gfx::Rect NormalPopupPosition(const gfx::Rect& old_pos, | 102 gfx::Rect NormalPopupPosition(const gfx::Rect& old_pos, |
| 103 const gfx::Rect& work_area); | 103 const gfx::Rect& work_area); |
| 104 | 104 |
| 105 // Align the location to the grid / snap to the right / bottom corner. | 105 // Align the location to the grid / snap to the right / bottom corner. |
| 106 gfx::Rect AlignPopupPosition(const gfx::Rect &pos, | 106 gfx::Rect AlignPopupPosition(const gfx::Rect& pos, |
| 107 const gfx::Rect &work_area, | 107 const gfx::Rect& work_area, |
| 108 int grid); | 108 int grid); |
| 109 | 109 |
| 110 // Constant exposed for unittest. | 110 // Constant exposed for unittest. |
| 111 static const int kMinimumWindowOffset; | 111 static const int kMinimumWindowOffset; |
| 112 | 112 |
| 113 wm::WmGlobals* globals_; | 113 wm::WmGlobals* globals_; |
| 114 | 114 |
| 115 // The offset in X and Y for the next popup which opens. | 115 // The offset in X and Y for the next popup which opens. |
| 116 int pop_position_offset_increment_x; | 116 int pop_position_offset_increment_x; |
| 117 int pop_position_offset_increment_y; | 117 int pop_position_offset_increment_y; |
| 118 | 118 |
| 119 // The position on the screen for the first popup which gets shown if no | 119 // The position on the screen for the first popup which gets shown if no |
| 120 // empty space can be found. | 120 // empty space can be found. |
| 121 int popup_position_offset_from_screen_corner_x; | 121 int popup_position_offset_from_screen_corner_x; |
| 122 int popup_position_offset_from_screen_corner_y; | 122 int popup_position_offset_from_screen_corner_y; |
| 123 | 123 |
| 124 // The last used position. | 124 // The last used position. |
| 125 int last_popup_position_x_; | 125 int last_popup_position_x_; |
| 126 int last_popup_position_y_; | 126 int last_popup_position_y_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(WindowPositioner); | 128 DISALLOW_COPY_AND_ASSIGN(WindowPositioner); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace ash | 131 } // namespace ash |
| 132 | 132 |
| 133 #endif // ASH_WM_WINDOW_POSITIONER_H_ | 133 #endif // ASH_WM_COMMON_WINDOW_POSITIONER_H_ |
| OLD | NEW |