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 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" | 5 #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" |
6 | 6 |
7 #include "ash/wm/window_resizer.h" | 7 #include "ash/wm/window_resizer.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 monitor1_bounds, monitor1_work_area, monitor2_bounds, bounds, work_area, | 228 monitor1_bounds, monitor1_work_area, monitor2_bounds, bounds, work_area, |
229 ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_DEFAULT, source, browser, | 229 ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_DEFAULT, source, browser, |
230 passed_in, out_bounds, &out_show_state); | 230 passed_in, out_bounds, &out_show_state); |
231 } | 231 } |
232 | 232 |
233 ui::WindowShowState GetWindowShowState( | 233 ui::WindowShowState GetWindowShowState( |
234 ui::WindowShowState show_state_persisted, | 234 ui::WindowShowState show_state_persisted, |
235 ui::WindowShowState show_state_last, | 235 ui::WindowShowState show_state_last, |
236 Source source, | 236 Source source, |
237 const Browser* browser, | 237 const Browser* browser, |
238 const gfx::Rect& bounds, | |
238 const gfx::Rect& display_config) { | 239 const gfx::Rect& display_config) { |
239 gfx::Rect bounds = display_config; | |
240 gfx::Rect work_area = display_config; | 240 gfx::Rect work_area = display_config; |
241 TestScreen test_screen; | 241 TestScreen test_screen; |
242 test_screen.AddDisplay(display_config, display_config); | 242 test_screen.AddDisplay(display_config, display_config); |
243 scoped_ptr<TestStateProvider> sp(new TestStateProvider); | 243 scoped_ptr<TestStateProvider> sp(new TestStateProvider); |
244 if (source == PERSISTED || source == BOTH) | 244 if (source == PERSISTED || source == BOTH) |
245 sp->SetPersistentState(bounds, work_area, show_state_persisted, true); | 245 sp->SetPersistentState(bounds, work_area, show_state_persisted, true); |
msw
2014/08/05 16:44:38
nit: nix |work_area|, inline |display_config| here
varkha
2014/08/05 17:55:23
Done.
| |
246 if (source == LAST_ACTIVE || source == BOTH) | 246 if (source == LAST_ACTIVE || source == BOTH) |
247 sp->SetLastActiveState(bounds, show_state_last, true); | 247 sp->SetLastActiveState(bounds, show_state_last, true); |
248 scoped_ptr<WindowSizer::TargetDisplayProvider> tdp( | 248 scoped_ptr<WindowSizer::TargetDisplayProvider> tdp( |
249 new TestTargetDisplayProvider); | 249 new TestTargetDisplayProvider); |
250 | 250 |
251 WindowSizer sizer(sp.PassAs<WindowSizer::StateProvider>(), | 251 WindowSizer sizer(sp.PassAs<WindowSizer::StateProvider>(), |
252 tdp.Pass(), &test_screen, browser); | 252 tdp.Pass(), &test_screen, browser); |
253 | 253 |
254 ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT; | 254 ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT; |
255 gfx::Rect out_bounds; | 255 gfx::Rect out_bounds; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 { // Check that a window which hangs out of the screen get moved back in. | 463 { // Check that a window which hangs out of the screen get moved back in. |
464 gfx::Rect window_bounds; | 464 gfx::Rect window_bounds; |
465 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), | 465 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), |
466 gfx::Rect(), DEFAULT, NULL, | 466 gfx::Rect(), DEFAULT, NULL, |
467 gfx::Rect(1020, 700, 100, 100), &window_bounds); | 467 gfx::Rect(1020, 700, 100, 100), &window_bounds); |
468 EXPECT_EQ("924,668 100x100", window_bounds.ToString()); | 468 EXPECT_EQ("924,668 100x100", window_bounds.ToString()); |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 #endif // defined(OS_MACOSX) | 472 #endif // defined(OS_MACOSX) |
OLD | NEW |