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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 UrlsToTabs(urls, &tabs); | 677 UrlsToTabs(urls, &tabs); |
678 } else if (pref.type == SessionStartupPref::URLS && !pref.urls.empty() && | 678 } else if (pref.type == SessionStartupPref::URLS && !pref.urls.empty() && |
679 !HasPendingUncleanExit(profile_)) { | 679 !HasPendingUncleanExit(profile_)) { |
680 // Optionally include the welcome page first. | 680 // Optionally include the welcome page first. |
681 if (welcome_run_type_ == WelcomeRunType::FIRST_TAB) | 681 if (welcome_run_type_ == WelcomeRunType::FIRST_TAB) |
682 UrlsToTabs(std::vector<GURL>(1, internals::GetWelcomePageURL()), &tabs); | 682 UrlsToTabs(std::vector<GURL>(1, internals::GetWelcomePageURL()), &tabs); |
683 // Only use the set of urls specified in preferences if nothing was | 683 // Only use the set of urls specified in preferences if nothing was |
684 // specified on the command line. Filter out any urls that are to be | 684 // specified on the command line. Filter out any urls that are to be |
685 // restored by virtue of having been previously pinned. | 685 // restored by virtue of having been previously pinned. |
686 AddUniqueURLs(pref.urls, &tabs); | 686 AddUniqueURLs(pref.urls, &tabs); |
687 } else if (pref.type == SessionStartupPref::HOMEPAGE) { | |
688 // If 'homepage' selected, either by the user or by a policy, we should | |
689 // have migrated them to another value. | |
690 NOTREACHED() << "SessionStartupPref has deprecated type HOMEPAGE"; | |
691 } | 687 } |
692 | 688 |
693 if (tabs.empty()) | 689 if (tabs.empty()) |
694 return NULL; | 690 return NULL; |
695 | 691 |
696 Browser* browser = OpenTabsInBrowser(NULL, true, tabs, desktop_type); | 692 Browser* browser = OpenTabsInBrowser(NULL, true, tabs, desktop_type); |
697 return browser; | 693 return browser; |
698 } | 694 } |
699 | 695 |
700 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, | 696 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 #endif // !OS_WIN | 968 #endif // !OS_WIN |
973 } | 969 } |
974 | 970 |
975 void StartupBrowserCreatorImpl::RecordRapporOnStartupURLs( | 971 void StartupBrowserCreatorImpl::RecordRapporOnStartupURLs( |
976 const std::vector<GURL>& urls_to_open) { | 972 const std::vector<GURL>& urls_to_open) { |
977 for (const GURL& url : urls_to_open) { | 973 for (const GURL& url : urls_to_open) { |
978 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 974 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
979 "Startup.BrowserLaunchURL", url); | 975 "Startup.BrowserLaunchURL", url); |
980 } | 976 } |
981 } | 977 } |
OLD | NEW |