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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 return; | 614 return; |
615 } | 615 } |
616 } | 616 } |
617 } | 617 } |
618 | 618 |
619 // Session startup didn't occur, open the urls. | 619 // Session startup didn't occur, open the urls. |
620 Browser* browser = NULL; | 620 Browser* browser = NULL; |
621 std::vector<GURL> adjust_urls = urls_to_open; | 621 std::vector<GURL> adjust_urls = urls_to_open; |
622 if (adjust_urls.empty()) { | 622 if (adjust_urls.empty()) { |
623 AddStartupURLs(&adjust_urls); | 623 AddStartupURLs(&adjust_urls); |
| 624 if (StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
| 625 profile_, adjust_urls)) |
| 626 return; |
624 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { | 627 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { |
625 // Always open a list of urls in a window on the native desktop. | 628 // Always open a list of urls in a window on the native desktop. |
626 browser = browser::FindBrowserWithProfile(profile_, | 629 browser = browser::FindBrowserWithProfile(profile_, |
627 chrome::HOST_DESKTOP_TYPE_NATIVE); | 630 chrome::HOST_DESKTOP_TYPE_NATIVE); |
628 } | 631 } |
629 | |
630 // This will launch a browser; prevent session restore. | 632 // This will launch a browser; prevent session restore. |
631 in_synchronous_profile_launch = true; | 633 in_synchronous_profile_launch = true; |
632 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); | 634 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls); |
633 in_synchronous_profile_launch = false; | 635 in_synchronous_profile_launch = false; |
634 AddInfoBarsIfNecessary(browser, is_process_startup); | 636 AddInfoBarsIfNecessary(browser, is_process_startup); |
635 } | 637 } |
636 | 638 |
637 bool StartupBrowserCreatorImpl::ProcessStartupURLs( | 639 bool StartupBrowserCreatorImpl::ProcessStartupURLs( |
638 const std::vector<GURL>& urls_to_open) { | 640 const std::vector<GURL>& urls_to_open) { |
639 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; | 641 VLOG(1) << "StartupBrowserCreatorImpl::ProcessStartupURLs"; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 // New: | 992 // New: |
991 prefs->GetString(prefs::kHomePage), | 993 prefs->GetString(prefs::kHomePage), |
992 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 994 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
993 prefs->GetBoolean(prefs::kShowHomeButton), | 995 prefs->GetBoolean(prefs::kShowHomeButton), |
994 // Backup: | 996 // Backup: |
995 backup_homepage, | 997 backup_homepage, |
996 backup_homepage_is_ntp, | 998 backup_homepage_is_ntp, |
997 backup_show_home_button)); | 999 backup_show_home_button)); |
998 } | 1000 } |
999 } | 1001 } |
| 1002 |
| 1003 #if !defined(OS_WIN) || defined(USE_AURA) |
| 1004 // static |
| 1005 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
| 1006 Profile* profile, |
| 1007 const std::vector<GURL>& startup_urls) { |
| 1008 return false; |
| 1009 } |
| 1010 #endif |
| 1011 |
OLD | NEW |