| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/window_sizer.h" | 5 #include "chrome/browser/window_sizer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_type.h" | 10 #include "chrome/browser/browser_type.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 state_provider_ = state_provider; | 197 state_provider_ = state_provider; |
| 198 monitor_info_provider_ = monitor_info_provider; | 198 monitor_info_provider_ = monitor_info_provider; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void WindowSizer::DetermineWindowBounds(const gfx::Rect& specified_bounds, | 201 void WindowSizer::DetermineWindowBounds(const gfx::Rect& specified_bounds, |
| 202 gfx::Rect* bounds, | 202 gfx::Rect* bounds, |
| 203 bool* maximized) const { | 203 bool* maximized) const { |
| 204 *bounds = specified_bounds; | 204 *bounds = specified_bounds; |
| 205 if (bounds->IsEmpty()) { | 205 if (bounds->IsEmpty()) { |
| 206 // See if there's saved placement information. | 206 // See if there's saved placement information. |
| 207 *maximized = false; // Default off; GetSavedWindowBounds() may set this. | |
| 208 if (!GetLastWindowBounds(bounds)) { | 207 if (!GetLastWindowBounds(bounds)) { |
| 209 if (!GetSavedWindowBounds(bounds, maximized)) { | 208 if (!GetSavedWindowBounds(bounds, maximized)) { |
| 210 // No saved placement, figure out some sensible default size based on | 209 // No saved placement, figure out some sensible default size based on |
| 211 // the user's screen size. | 210 // the user's screen size. |
| 212 GetDefaultWindowBounds(bounds); | 211 GetDefaultWindowBounds(bounds); |
| 213 } | 212 } |
| 214 } | 213 } |
| 215 } | 214 } |
| 216 } | 215 } |
| 217 | 216 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 if ((bottom_offscreen || top_offscreen) && | 341 if ((bottom_offscreen || top_offscreen) && |
| 343 bounds->bottom() > work_area.bottom()) { | 342 bounds->bottom() > work_area.bottom()) { |
| 344 bounds->set_height(work_area.height() - 2 * kWindowTilePixels); | 343 bounds->set_height(work_area.height() - 2 * kWindowTilePixels); |
| 345 } | 344 } |
| 346 if ((left_offscreen || right_offscreen) && | 345 if ((left_offscreen || right_offscreen) && |
| 347 bounds->right() > work_area.right()) { | 346 bounds->right() > work_area.right()) { |
| 348 bounds->set_width(work_area.width() - 2 * kWindowTilePixels); | 347 bounds->set_width(work_area.width() - 2 * kWindowTilePixels); |
| 349 } | 348 } |
| 350 } | 349 } |
| 351 | 350 |
| OLD | NEW |