Chromium Code Reviews| 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..19cd6568fad7400e157a1cef347a823e0fa32f2d 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. |
| @@ -106,6 +116,29 @@ class StartupBrowserCreatorImpl { |
| void ProcessLaunchURLs(bool process_startup, |
| const std::vector<GURL>& urls_to_open); |
| + // 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. |
| + // This method is a refactoring of ProcessLaunchURLs above, and will replace |
| + // that code path entirely once kUseConsolidatedStartupFlow is on by default. |
|
Peter Kasting
2016/09/29 07:23:34
Nit: For this last sentence, consider instead putt
|
| + 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); |
| + |
| + // Opens the given tabs in a new browser. |
|
Peter Kasting
2016/09/29 07:23:34
Nit: It's not clear from this comment how this is
|
| + // TODO(tmartino): Add the ability to restore a session, and an additional |
| + // argument which indicates which behavior (new or restored) should be used. |
| + Browser* RestoreOrCreateBrowser(bool process_startup, |
| + const StartupTabs& tabs); |
| + |
| // Does the following: |
| // . If the user's startup pref is to restore the last session (or the |
| // command line flag is present to force using last session), it is |