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

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

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
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 #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
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 window |bounds| and various system states which have an influence
128 // the WindowSizer. 128 // on the WindowSizer and then determines the resulting show state from it.
129 // The |display_config| is the primary display configuration used. 129 // |bounds| specifies the |browser| last or persistent bounds depending on
130 // |source|. The |display_config| is the primary display configuration used.
130 ui::WindowShowState GetWindowShowState( 131 ui::WindowShowState GetWindowShowState(
131 ui::WindowShowState show_state_persisted, 132 ui::WindowShowState show_state_persisted,
132 ui::WindowShowState show_state_last, 133 ui::WindowShowState show_state_last,
133 Source source, 134 Source source,
134 const Browser* browser, 135 const Browser* browser,
136 const gfx::Rect& bounds,
135 const gfx::Rect& display_config); 137 const gfx::Rect& display_config);
136 138
137 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ 139 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698