| 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 // TODO(scottmg): NativeScreen might be wrong. http://crbug.com/133312 |
| 445 const gfx::Rect work_area = |
| 446 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); |
| 445 width = std::min(width, work_area.width()); | 447 width = std::min(width, work_area.width()); |
| 446 height = std::min(height, work_area.height()); | 448 height = std::min(height, work_area.height()); |
| 447 bounds->set_size(gfx::Size(width, height)); | 449 bounds->set_size(gfx::Size(width, height)); |
| 448 bounds->set_x((work_area.width() - bounds->width()) / 2); | 450 bounds->set_x((work_area.width() - bounds->width()) / 2); |
| 449 // TODO(nkostylev): work_area does include launcher but should not. | 451 // TODO(nkostylev): work_area does include launcher but should not. |
| 450 // Launcher auto hide pref is synced and is most likely not applied here. | 452 // Launcher auto hide pref is synced and is most likely not applied here. |
| 451 bounds->set_y((work_area.height() - bounds->height()) / 2); | 453 bounds->set_y((work_area.height() - bounds->height()) / 2); |
| 452 } | 454 } |
| 453 } | 455 } |
| 454 } | 456 } |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 // New: | 1003 // New: |
| 1002 prefs->GetString(prefs::kHomePage), | 1004 prefs->GetString(prefs::kHomePage), |
| 1003 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 1005 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
| 1004 prefs->GetBoolean(prefs::kShowHomeButton), | 1006 prefs->GetBoolean(prefs::kShowHomeButton), |
| 1005 // Backup: | 1007 // Backup: |
| 1006 backup_homepage, | 1008 backup_homepage, |
| 1007 backup_homepage_is_ntp, | 1009 backup_homepage_is_ntp, |
| 1008 backup_show_home_button)); | 1010 backup_show_home_button)); |
| 1009 } | 1011 } |
| 1010 } | 1012 } |
| OLD | NEW |