| Index: chrome/browser/ui/startup/startup_browser_creator_impl.h
|
| diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.h b/chrome/browser/ui/startup/startup_browser_creator_impl.h
|
| index 2f5652c5af5d86d4fb80a9feb4801ac1431048cb..7cc98d360d1c914372b1b10d7b955511c1bb9ae2 100644
|
| --- a/chrome/browser/ui/startup/startup_browser_creator_impl.h
|
| +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "chrome/browser/ui/startup/startup_tab.h"
|
| +#include "chrome/browser/ui/startup/startup_tab_provider.h"
|
| #include "chrome/browser/ui/startup/startup_types.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -67,6 +68,15 @@ class StartupBrowserCreatorImpl {
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(BrowserTest, RestorePinnedTabs);
|
| FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
|
| + FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorImplTest, DetermineStartupTabs);
|
| + FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorImplTest,
|
| + DetermineStartupTabs_IncognitoOrCrash);
|
| + FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorImplTest,
|
| + DetermineStartupTabs_MasterPrefs);
|
| + FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorImplTest,
|
| + DetermineStartupTabs_CommandLine);
|
| + FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorImplTest,
|
| + DetermineStartupTabs_NewTabPage);
|
|
|
| enum class WelcomeRunType {
|
| NONE, // Do not inject the welcome page for this run.
|
| @@ -97,12 +107,44 @@ class StartupBrowserCreatorImpl {
|
| // should open in a tab, do so.
|
| bool OpenApplicationTab(Profile* profile);
|
|
|
| + // Determines the URLs to be shown at startup by way of various policies
|
| + // (onboarding, pinned tabs, etc.), determines whether a session restore
|
| + // is necessary, and opens the URLs in a new or restored browser accordingly.
|
| + void ProcessLaunchUrlsUsingConsolidatedFlow(
|
| + bool process_startup,
|
| + const std::vector<GURL>& cmd_line_urls);
|
| +
|
| + // Returns the tabs to be shown on startup, based on the policy functions in
|
| + // the given StartupTabProvider, the given tabs passed by the command line,
|
| + // and the interactions between those policies.
|
| + StartupTabs DetermineStartupTabs(const StartupTabProvider& provider,
|
| + const StartupTabs& cmd_line_tabs,
|
| + bool is_incognito,
|
| + bool is_post_crash_launch);
|
| +
|
| + // Adds a Tab to |tabs| for each url in |urls| that doesn't already exist
|
| + // in |tabs|.
|
| + void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs);
|
| +
|
| + // Adds any startup infobars to the selected tab of the given browser.
|
| + void AddInfoBarsIfNecessary(
|
| + Browser* browser,
|
| + chrome::startup::IsProcessStartup is_process_startup);
|
| +
|
| + // Records Rappor metrics on startup URLs.
|
| + void RecordRapporOnStartupURLs(const std::vector<GURL>& urls_to_open);
|
| +
|
| + // TODO(crbug.com/651465): The following functions are deprecated. They will
|
| + // be removed once kUseConsolidatedStartupFlow is enabled by default.
|
| +
|
| // Invoked from Launch to handle processing of urls. This may do any of the
|
| // following:
|
| // . Invoke ProcessStartupURLs if |process_startup| is true.
|
| // . If |process_startup| is false, restore the last session if necessary,
|
| // or invoke ProcessSpecifiedURLs.
|
| // . Open the urls directly.
|
| + // Under the kUseConsolidatedStartupFlow feature, this is replaced by
|
| + // ProcessLaunchUrlsUsingConsolidatedFlow().
|
| void ProcessLaunchURLs(bool process_startup,
|
| const std::vector<GURL>& urls_to_open);
|
|
|
| @@ -128,15 +170,6 @@ class StartupBrowserCreatorImpl {
|
| // Otherwise null is returned and the caller must create a new browser.
|
| Browser* ProcessSpecifiedURLs(const std::vector<GURL>& urls_to_open);
|
|
|
| - // Adds a Tab to |tabs| for each url in |urls| that doesn't already exist
|
| - // in |tabs|.
|
| - void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs);
|
| -
|
| - // Adds any startup infobars to the selected tab of the given browser.
|
| - void AddInfoBarsIfNecessary(
|
| - Browser* browser,
|
| - chrome::startup::IsProcessStartup is_process_startup);
|
| -
|
| // Adds additional startup URLs to the specified vector.
|
| void AddStartupURLs(std::vector<GURL>* startup_urls) const;
|
|
|
| @@ -149,9 +182,6 @@ class StartupBrowserCreatorImpl {
|
| // suppress injecting the welcome page for future launches.
|
| void InitializeWelcomeRunType(const std::vector<GURL>& urls_to_open);
|
|
|
| - // Record Rappor metrics on startup URLs.
|
| - void RecordRapporOnStartupURLs(const std::vector<GURL>& urls_to_open);
|
| -
|
| // Checks whether |profile_| has a reset trigger set.
|
| bool ProfileHasResetTrigger() const;
|
|
|
|
|