| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return distribution_tabs; | 654 return distribution_tabs; |
| 655 | 655 |
| 656 // Policies for onboarding (e.g., first run) may show promotional and | 656 // Policies for onboarding (e.g., first run) may show promotional and |
| 657 // introductory content depending on a number of system status factors, | 657 // introductory content depending on a number of system status factors, |
| 658 // including OS and whether or not this is First Run. | 658 // including OS and whether or not this is First Run. |
| 659 StartupTabs onboarding_tabs = provider.GetOnboardingTabs(); | 659 StartupTabs onboarding_tabs = provider.GetOnboardingTabs(); |
| 660 AppendTabs(onboarding_tabs, &tabs); | 660 AppendTabs(onboarding_tabs, &tabs); |
| 661 | 661 |
| 662 // If the user has set the preference indicating URLs to show on opening, | 662 // If the user has set the preference indicating URLs to show on opening, |
| 663 // read and add those. | 663 // read and add those. |
| 664 StartupTabs prefs_tabs = provider.GetPreferencesTabs(); | 664 StartupTabs prefs_tabs = provider.GetPreferencesTabs(command_line_, profile_); |
| 665 AppendTabs(prefs_tabs, &tabs); | 665 AppendTabs(prefs_tabs, &tabs); |
| 666 | 666 |
| 667 // Potentially add the New Tab Page. Onboarding content is designed to | 667 // Potentially add the New Tab Page. Onboarding content is designed to |
| 668 // replace (and eventually funnel the user to) the NTP. Likewise, URLs read | 668 // replace (and eventually funnel the user to) the NTP. Likewise, URLs read |
| 669 // from preferences are explicitly meant to override showing the NTP. | 669 // from preferences are explicitly meant to override showing the NTP. |
| 670 if (onboarding_tabs.empty() && prefs_tabs.empty()) | 670 if (onboarding_tabs.empty() && prefs_tabs.empty()) |
| 671 tabs.emplace_back(GURL(chrome::kChromeUINewTabURL), false); | 671 tabs.emplace_back(GURL(chrome::kChromeUINewTabURL), false); |
| 672 | 672 |
| 673 // Add any tabs which the user has previously pinned. | 673 // Add any tabs which the user has previously pinned. |
| 674 AppendTabs(provider.GetPinnedTabs(), &tabs); | 674 AppendTabs(provider.GetPinnedTabs(profile_), &tabs); |
| 675 | 675 |
| 676 return tabs; | 676 return tabs; |
| 677 } | 677 } |
| 678 | 678 |
| 679 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, | 679 void StartupBrowserCreatorImpl::AddUniqueURLs(const std::vector<GURL>& urls, |
| 680 StartupTabs* tabs) { | 680 StartupTabs* tabs) { |
| 681 size_t num_existing_tabs = tabs->size(); | 681 size_t num_existing_tabs = tabs->size(); |
| 682 for (size_t i = 0; i < urls.size(); ++i) { | 682 for (size_t i = 0; i < urls.size(); ++i) { |
| 683 bool in_tabs = false; | 683 bool in_tabs = false; |
| 684 for (size_t j = 0; j < num_existing_tabs; ++j) { | 684 for (size_t j = 0; j < num_existing_tabs; ++j) { |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 #if defined(OS_WIN) | 1081 #if defined(OS_WIN) |
| 1082 TriggeredProfileResetter* triggered_profile_resetter = | 1082 TriggeredProfileResetter* triggered_profile_resetter = |
| 1083 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1083 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
| 1084 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1084 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
| 1085 if (triggered_profile_resetter) { | 1085 if (triggered_profile_resetter) { |
| 1086 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1086 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
| 1087 } | 1087 } |
| 1088 #endif // defined(OS_WIN) | 1088 #endif // defined(OS_WIN) |
| 1089 return has_reset_trigger; | 1089 return has_reset_trigger; |
| 1090 } | 1090 } |
| OLD | NEW |