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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 #if defined(OS_WIN) | 992 #if defined(OS_WIN) |
997 TriggeredProfileResetter* triggered_profile_resetter = | 993 TriggeredProfileResetter* triggered_profile_resetter = |
998 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 994 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
999 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 995 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
1000 if (triggered_profile_resetter) { | 996 if (triggered_profile_resetter) { |
1001 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 997 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1002 } | 998 } |
1003 #endif // defined(OS_WIN) | 999 #endif // defined(OS_WIN) |
1004 return has_reset_trigger; | 1000 return has_reset_trigger; |
1005 } | 1001 } |
OLD | NEW |