Chromium Code Reviews| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 return; | 610 return; |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 } | 613 } |
| 614 | 614 |
| 615 // Session startup didn't occur, open the urls. | 615 // Session startup didn't occur, open the urls. |
| 616 Browser* browser = NULL; | 616 Browser* browser = NULL; |
| 617 std::vector<GURL> adjust_urls = urls_to_open; | 617 std::vector<GURL> adjust_urls = urls_to_open; |
| 618 if (adjust_urls.empty()) { | 618 if (adjust_urls.empty()) { |
| 619 AddStartupURLs(&adjust_urls); | 619 AddStartupURLs(&adjust_urls); |
| 620 if (StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | |
| 621 profile_, adjust_urls)) | |
| 622 return; | |
| 620 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { | 623 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { |
| 621 // Always open a list of urls in a window on the native desktop. | 624 // Always open a list of urls in a window on the native desktop. |
| 622 browser = browser::FindBrowserWithProfile(profile_, | 625 browser = browser::FindBrowserWithProfile(profile_, |
| 623 chrome::HOST_DESKTOP_TYPE_NATIVE); | 626 chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 624 } | 627 } |
| 625 | |
| 626 // This will launch a browser; prevent session restore. | 628 // This will launch a browser; prevent session restore. |
| 627 in_synchronous_profile_launch = true; | 629 in_synchronous_profile_launch = true; |
| 628 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); | 630 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); |
| 629 in_synchronous_profile_launch = false; | 631 in_synchronous_profile_launch = false; |
| 630 AddInfoBarsIfNecessary(browser, is_process_startup); | 632 AddInfoBarsIfNecessary(browser, is_process_startup); |
| 631 } | 633 } |
| 632 | 634 |
| 633 bool StartupBrowserCreatorImpl::ProcessStartupURLs( | 635 bool StartupBrowserCreatorImpl::ProcessStartupURLs( |
| 634 const std::vector<GURL>& urls_to_open) { | 636 const std::vector<GURL>& urls_to_open) { |
| 635 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; | 637 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1026 // New: | 1028 // New: |
| 1027 prefs->GetString(prefs::kHomePage), | 1029 prefs->GetString(prefs::kHomePage), |
| 1028 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 1030 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
| 1029 prefs->GetBoolean(prefs::kShowHomeButton), | 1031 prefs->GetBoolean(prefs::kShowHomeButton), |
| 1030 // Backup: | 1032 // Backup: |
| 1031 backup_homepage, | 1033 backup_homepage, |
| 1032 backup_homepage_is_ntp, | 1034 backup_homepage_is_ntp, |
| 1033 backup_show_home_button)); | 1035 backup_show_home_button)); |
| 1034 } | 1036 } |
| 1035 } | 1037 } |
| 1038 | |
| 1039 #if !defined(OS_WIN) || defined(USE_AURA) | |
| 1040 // static | |
| 1041 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | |
| 1042 Profile* profile, const std::vector<GURL>& startup_urls) { | |
|
sky
2012/10/16 22:06:15
Same thing about wrapping here. Also, why the USE_
ananta
2012/10/16 22:14:58
Fixed the wrapping. Regarding AURA this code path
| |
| 1043 return false; | |
| 1044 } | |
| 1045 #endif | |
| 1046 | |
| OLD | NEW |