Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (nits, restricts to tabbed browsers) Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/window_sizer/window_sizer_common_unittest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
241 TestScreen test_screen; 240 TestScreen test_screen;
242 test_screen.AddDisplay(display_config, display_config); 241 test_screen.AddDisplay(display_config, display_config);
243 scoped_ptr<TestStateProvider> sp(new TestStateProvider); 242 scoped_ptr<TestStateProvider> sp(new TestStateProvider);
244 if (source == PERSISTED || source == BOTH) 243 if (source == PERSISTED || source == BOTH)
245 sp->SetPersistentState(bounds, work_area, show_state_persisted, true); 244 sp->SetPersistentState(bounds, display_config, show_state_persisted, true);
246 if (source == LAST_ACTIVE || source == BOTH) 245 if (source == LAST_ACTIVE || source == BOTH)
247 sp->SetLastActiveState(bounds, show_state_last, true); 246 sp->SetLastActiveState(bounds, show_state_last, true);
248 scoped_ptr<WindowSizer::TargetDisplayProvider> tdp( 247 scoped_ptr<WindowSizer::TargetDisplayProvider> tdp(
249 new TestTargetDisplayProvider); 248 new TestTargetDisplayProvider);
250 249
251 WindowSizer sizer(sp.PassAs<WindowSizer::StateProvider>(), 250 WindowSizer sizer(sp.PassAs<WindowSizer::StateProvider>(),
252 tdp.Pass(), &test_screen, browser); 251 tdp.Pass(), &test_screen, browser);
253 252
254 ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT; 253 ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT;
255 gfx::Rect out_bounds; 254 gfx::Rect out_bounds;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 { // Check that a window which hangs out of the screen get moved back in. 462 { // Check that a window which hangs out of the screen get moved back in.
464 gfx::Rect window_bounds; 463 gfx::Rect window_bounds;
465 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), 464 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(),
466 gfx::Rect(), DEFAULT, NULL, 465 gfx::Rect(), DEFAULT, NULL,
467 gfx::Rect(1020, 700, 100, 100), &window_bounds); 466 gfx::Rect(1020, 700, 100, 100), &window_bounds);
468 EXPECT_EQ("924,668 100x100", window_bounds.ToString()); 467 EXPECT_EQ("924,668 100x100", window_bounds.ToString());
469 } 468 }
470 } 469 }
471 470
472 #endif // defined(OS_MACOSX) 471 #endif // defined(OS_MACOSX)
OLDNEW
« no previous file with comments | « chrome/browser/ui/window_sizer/window_sizer_common_unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698