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 7cc98d360d1c914372b1b10d7b955511c1bb9ae2..ac5f34951f1031e273e837ad9687de94aee7d064 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator_impl.h |
| +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.h |
| @@ -84,6 +84,12 @@ class StartupBrowserCreatorImpl { |
| FIRST_RUN_LAST_TAB, // Inject the welcome page as the last first-run tab. |
| }; |
| + enum class BrowserOpenBehavior { |
| + NEW, // Open in a new browser. |
| + SYNCHRONOUS_RESTORE, // Attempt a synchronous session restore. |
| + USE_EXISTING // Attempt to add to an existing tabbed browser. |
|
grt (UTC plus 2)
2016/10/28 09:22:12
nit: add a trailing comma
tmartino
2016/10/28 18:34:27
Done
|
| + }; |
| + |
| // Creates a tab for each of the Tabs in |tabs|. If browser is non-null |
| // and a tabbed browser, the tabs are added to it. Otherwise a new tabbed |
| // browser is created and the tabs are added to it. The browser the tabs |
| @@ -122,6 +128,37 @@ class StartupBrowserCreatorImpl { |
| bool is_incognito, |
| bool is_post_crash_launch); |
| + // Determines whether an asynchronous session restore is necessary; if so, |
| + // kicks one off and returns true. |
| + bool MaybeAsyncRestore(const StartupTabs& tabs, |
| + bool process_startup, |
| + bool is_post_crash_launch); |
| + |
| + // Returns a browser displaying the contents of |tabs|. Based on |behavior|, |
| + // this may attempt a session restore or create a new browser. May also allow |
| + // DOM Storage to begin cleanup once it's clear it is not needed anymore. |
| + Browser* RestoreOrCreateBrowser(const StartupTabs& tabs, |
| + BrowserOpenBehavior behavior, |
| + uint32_t restore_options, |
| + bool process_startup, |
| + bool is_post_crash_launch); |
| + |
| + // Determines how the launch flow should obtain a Browser. |
| + static BrowserOpenBehavior DetermineBrowserOpenBehavior( |
| + const SessionStartupPref& pref, |
| + bool process_startup, |
| + bool is_post_crash_launch, |
| + bool has_restore_switch, |
| + bool has_new_window_switch, |
| + bool has_cmd_line_tabs); |
| + |
| + // Populates and returns the relevant bitmask options which must be passed |
| + // when restoring a session. |
| + static uint32_t DetermineSynchronousRestoreOptions( |
| + bool has_create_browser_default, |
| + bool has_create_browser_switch, |
| + bool was_mac_login_or_resume); |
| + |
| // 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); |