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 "apps/app_restore_service.h" | 10 #include "apps/app_restore_service.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 return; | 583 return; |
584 } | 584 } |
585 } | 585 } |
586 } | 586 } |
587 | 587 |
588 // Session startup didn't occur, open the urls. | 588 // Session startup didn't occur, open the urls. |
589 Browser* browser = NULL; | 589 Browser* browser = NULL; |
590 std::vector<GURL> adjust_urls = urls_to_open; | 590 std::vector<GURL> adjust_urls = urls_to_open; |
591 if (adjust_urls.empty()) { | 591 if (adjust_urls.empty()) { |
592 AddStartupURLs(&adjust_urls); | 592 AddStartupURLs(&adjust_urls); |
593 if (StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | |
594 profile_, adjust_urls)) | |
595 return; | |
596 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { | 593 } else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) { |
597 // Always open a list of urls in a window on the native desktop. | 594 // Always open a list of urls in a window on the native desktop. |
598 browser = chrome::FindTabbedBrowser(profile_, false, | 595 browser = chrome::FindTabbedBrowser(profile_, false, |
599 chrome::HOST_DESKTOP_TYPE_NATIVE); | 596 chrome::HOST_DESKTOP_TYPE_NATIVE); |
600 } | 597 } |
601 // This will launch a browser; prevent session restore. | 598 // This will launch a browser; prevent session restore. |
602 StartupBrowserCreator::in_synchronous_profile_launch_ = true; | 599 StartupBrowserCreator::in_synchronous_profile_launch_ = true; |
603 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls, | 600 browser = OpenURLsInBrowser(browser, process_startup, adjust_urls, |
604 desktop_type); | 601 desktop_type); |
605 StartupBrowserCreator::in_synchronous_profile_launch_ = false; | 602 StartupBrowserCreator::in_synchronous_profile_launch_ = false; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 // If the first URL is the NTP, replace it with the sync promo. This | 930 // If the first URL is the NTP, replace it with the sync promo. This |
934 // behavior is desired because completing or skipping the sync promo | 931 // behavior is desired because completing or skipping the sync promo |
935 // causes a redirect to the NTP. | 932 // causes a redirect to the NTP. |
936 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) | 933 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) |
937 startup_urls->at(0) = sync_promo_url; | 934 startup_urls->at(0) = sync_promo_url; |
938 else | 935 else |
939 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 936 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
940 } | 937 } |
941 } | 938 } |
942 } | 939 } |
943 | |
944 #if !defined(OS_WIN) | |
945 // static | |
946 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | |
947 Profile* profile, | |
948 const std::vector<GURL>& startup_urls) { | |
949 return false; | |
950 } | |
951 #endif | |
OLD | NEW |