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 CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ |
6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ | 6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 ui::WindowShowState last_active_show_state_; | 82 ui::WindowShowState last_active_show_state_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(TestStateProvider); | 84 DISALLOW_COPY_AND_ASSIGN(TestStateProvider); |
85 }; | 85 }; |
86 | 86 |
87 // Several convenience functions which allow to set up a state for | 87 // Several convenience functions which allow to set up a state for |
88 // window sizer test operations with a single call. | 88 // window sizer test operations with a single call. |
89 | 89 |
90 enum Source { DEFAULT, LAST_ACTIVE, PERSISTED, BOTH }; | 90 enum Source { DEFAULT, LAST_ACTIVE, PERSISTED, BOTH }; |
91 | 91 |
92 // Set up the window bounds, monitor bounds, show states and more to get the | 92 // Sets up the window bounds, monitor bounds, show states and more to get the |
93 // resulting |out_bounds| and |out_show_state| from the WindowSizer. | 93 // resulting |out_bounds| and |out_show_state| from the WindowSizer. |
94 // |source| specifies which type of data gets set for the test: Either the | 94 // |source| specifies which type of data gets set for the test: Either the |
95 // last active window, the persisted value which was stored earlier, both or | 95 // last active window, the persisted value which was stored earlier, both or |
96 // none. For all these states the |bounds| and |work_area| get used, for the | 96 // none. For all these states the |bounds| and |work_area| get used, for the |
97 // show states either |show_state_persisted| or |show_state_last| will be used. | 97 // show states either |show_state_persisted| or |show_state_last| will be used. |
98 void GetWindowBoundsAndShowState(const gfx::Rect& monitor1_bounds, | 98 void GetWindowBoundsAndShowState(const gfx::Rect& monitor1_bounds, |
99 const gfx::Rect& monitor1_work_area, | 99 const gfx::Rect& monitor1_work_area, |
100 const gfx::Rect& monitor2_bounds, | 100 const gfx::Rect& monitor2_bounds, |
101 const gfx::Rect& bounds, | 101 const gfx::Rect& bounds, |
102 const gfx::Rect& work_area, | 102 const gfx::Rect& work_area, |
103 ui::WindowShowState show_state_persisted, | 103 ui::WindowShowState show_state_persisted, |
104 ui::WindowShowState show_state_last, | 104 ui::WindowShowState show_state_last, |
105 Source source, | 105 Source source, |
106 const Browser* browser, | 106 const Browser* browser, |
107 const gfx::Rect& passed_in, | 107 const gfx::Rect& passed_in, |
108 gfx::Rect* out_bounds, | 108 gfx::Rect* out_bounds, |
109 ui::WindowShowState* out_show_state); | 109 ui::WindowShowState* out_show_state); |
110 | 110 |
111 // Set up the window bounds, monitor bounds, and work area to get the | 111 // Sets up the window bounds, monitor bounds, and work area to get the |
112 // resulting |out_bounds| from the WindowSizer. | 112 // resulting |out_bounds| from the WindowSizer. |
113 // |source| specifies which type of data gets set for the test: Either the | 113 // |source| specifies which type of data gets set for the test: Either the |
114 // last active window, the persisted value which was stored earlier, both or | 114 // last active window, the persisted value which was stored earlier, both or |
115 // none. For all these states the |bounds| and |work_area| get used, for the | 115 // none. For all these states the |bounds| and |work_area| get used, for the |
116 // show states either |show_state_persisted| or |show_state_last| will be used. | 116 // show states either |show_state_persisted| or |show_state_last| will be used. |
117 void GetWindowBounds(const gfx::Rect& monitor1_bounds, | 117 void GetWindowBounds(const gfx::Rect& monitor1_bounds, |
118 const gfx::Rect& monitor1_work_area, | 118 const gfx::Rect& monitor1_work_area, |
119 const gfx::Rect& monitor2_bounds, | 119 const gfx::Rect& monitor2_bounds, |
120 const gfx::Rect& bounds, | 120 const gfx::Rect& bounds, |
121 const gfx::Rect& work_area, | 121 const gfx::Rect& work_area, |
122 Source source, | 122 Source source, |
123 const Browser* browser, | 123 const Browser* browser, |
124 const gfx::Rect& passed_in, | 124 const gfx::Rect& passed_in, |
125 gfx::Rect* out_bounds); | 125 gfx::Rect* out_bounds); |
126 | 126 |
127 // Set up the various show states and get the resulting show state from | 127 // Sets up the various show states and get the resulting show state from |
Mr4D (OOO till 08-26)
2014/08/05 17:29:11
This comment appears to be somewhat outdated throu
varkha
2014/08/05 17:55:23
Done.
| |
128 // the WindowSizer. | 128 // the WindowSizer. |
129 // |bounds| specifies the |browser| last or persistent bounds depending on | |
msw
2014/08/05 16:44:39
nit: start this on the line above.
varkha
2014/08/05 17:55:23
Done.
| |
130 // |source|. | |
129 // The |display_config| is the primary display configuration used. | 131 // The |display_config| is the primary display configuration used. |
130 ui::WindowShowState GetWindowShowState( | 132 ui::WindowShowState GetWindowShowState( |
msw
2014/08/05 16:44:38
You should have skuhne@ review the changes to GetW
varkha
2014/08/05 17:55:23
Acknowledged.
| |
131 ui::WindowShowState show_state_persisted, | 133 ui::WindowShowState show_state_persisted, |
132 ui::WindowShowState show_state_last, | 134 ui::WindowShowState show_state_last, |
133 Source source, | 135 Source source, |
134 const Browser* browser, | 136 const Browser* browser, |
137 const gfx::Rect& bounds, | |
135 const gfx::Rect& display_config); | 138 const gfx::Rect& display_config); |
136 | 139 |
137 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ | 140 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ |
OLD | NEW |