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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 } else if (pref.type == SessionStartupPref::URLS && !pref.urls.empty() && | 674 } else if (pref.type == SessionStartupPref::URLS && !pref.urls.empty() && |
675 !HasPendingUncleanExit(profile_)) { | 675 !HasPendingUncleanExit(profile_)) { |
676 std::vector<GURL> extra_urls; | 676 std::vector<GURL> extra_urls; |
677 AddSpecialURLs(&extra_urls); | 677 AddSpecialURLs(&extra_urls); |
678 UrlsToTabs(extra_urls, &tabs); | 678 UrlsToTabs(extra_urls, &tabs); |
679 | 679 |
680 // Only use the set of urls specified in preferences if nothing was | 680 // Only use the set of urls specified in preferences if nothing was |
681 // specified on the command line. Filter out any urls that are to be | 681 // specified on the command line. Filter out any urls that are to be |
682 // restored by virtue of having been previously pinned. | 682 // restored by virtue of having been previously pinned. |
683 AddUniqueURLs(pref.urls, &tabs); | 683 AddUniqueURLs(pref.urls, &tabs); |
684 } else if (pref.type == SessionStartupPref::HOMEPAGE) { | |
685 // If 'homepage' selected, either by the user or by a policy, we should | |
686 // have migrated them to another value. | |
687 NOTREACHED() << "SessionStartupPref has deprecated type HOMEPAGE"; | |
688 } | 684 } |
689 | 685 |
690 if (tabs.empty()) | 686 if (tabs.empty()) |
691 return NULL; | 687 return NULL; |
692 | 688 |
693 Browser* browser = OpenTabsInBrowser(NULL, true, tabs, desktop_type); | 689 Browser* browser = OpenTabsInBrowser(NULL, true, tabs, desktop_type); |
694 return browser; | 690 return browser; |
695 } | 691 } |
696 | 692 |
697 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, | 693 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 #if defined(OS_WIN) | 991 #if defined(OS_WIN) |
996 TriggeredProfileResetter* triggered_profile_resetter = | 992 TriggeredProfileResetter* triggered_profile_resetter = |
997 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 993 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
998 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 994 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
999 if (triggered_profile_resetter) { | 995 if (triggered_profile_resetter) { |
1000 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 996 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1001 } | 997 } |
1002 #endif // defined(OS_WIN) | 998 #endif // defined(OS_WIN) |
1003 return has_reset_trigger; | 999 return has_reset_trigger; |
1004 } | 1000 } |
OLD | NEW |