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/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 } | 434 } |
435 | 435 |
436 void StartupBrowserCreatorImpl::ExtractOptionalAppWindowSize( | 436 void StartupBrowserCreatorImpl::ExtractOptionalAppWindowSize( |
437 gfx::Rect* bounds) { | 437 gfx::Rect* bounds) { |
438 if (command_line_.HasSwitch(switches::kAppWindowSize)) { | 438 if (command_line_.HasSwitch(switches::kAppWindowSize)) { |
439 int width, height; | 439 int width, height; |
440 width = height = 0; | 440 width = height = 0; |
441 std::string switch_value = | 441 std::string switch_value = |
442 command_line_.GetSwitchValueASCII(switches::kAppWindowSize); | 442 command_line_.GetSwitchValueASCII(switches::kAppWindowSize); |
443 if (ParseCommaSeparatedIntegers(switch_value, &width, &height)) { | 443 if (ParseCommaSeparatedIntegers(switch_value, &width, &height)) { |
444 const gfx::Rect work_area = gfx::Screen::GetPrimaryDisplay().work_area(); | 444 const gfx::Rect work_area = gfx::Screen::GetPrimaryDisplay( |
445 gfx::Screen::BadTwoWorldsContext()).work_area(); | |
oshima
2012/10/04 20:18:26
I guess session restore has to remember in which s
| |
445 width = std::min(width, work_area.width()); | 446 width = std::min(width, work_area.width()); |
446 height = std::min(height, work_area.height()); | 447 height = std::min(height, work_area.height()); |
447 bounds->set_size(gfx::Size(width, height)); | 448 bounds->set_size(gfx::Size(width, height)); |
448 bounds->set_x((work_area.width() - bounds->width()) / 2); | 449 bounds->set_x((work_area.width() - bounds->width()) / 2); |
449 // TODO(nkostylev): work_area does include launcher but should not. | 450 // TODO(nkostylev): work_area does include launcher but should not. |
450 // Launcher auto hide pref is synced and is most likely not applied here. | 451 // Launcher auto hide pref is synced and is most likely not applied here. |
451 bounds->set_y((work_area.height() - bounds->height()) / 2); | 452 bounds->set_y((work_area.height() - bounds->height()) / 2); |
452 } | 453 } |
453 } | 454 } |
454 } | 455 } |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 // New: | 1002 // New: |
1002 prefs->GetString(prefs::kHomePage), | 1003 prefs->GetString(prefs::kHomePage), |
1003 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 1004 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
1004 prefs->GetBoolean(prefs::kShowHomeButton), | 1005 prefs->GetBoolean(prefs::kShowHomeButton), |
1005 // Backup: | 1006 // Backup: |
1006 backup_homepage, | 1007 backup_homepage, |
1007 backup_homepage_is_ntp, | 1008 backup_homepage_is_ntp, |
1008 backup_show_home_button)); | 1009 backup_show_home_button)); |
1009 } | 1010 } |
1010 } | 1011 } |
OLD | NEW |