| 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..978ed4eda0716b0317e7ce05283e774b5a3c034e 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.
|
| + };
|
| +
|
| // 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,40 @@ class StartupBrowserCreatorImpl {
|
| bool is_incognito,
|
| bool is_post_crash_launch);
|
|
|
| + // Begins an asynchronous session restore if current state allows it (e.g.,
|
| + // this is not process startup) and SessionService indicates that one is
|
| + // necessary. Returns true if restore was initiated, or false if launch
|
| + // should continue (either synchronously, or asynchronously without
|
| + // restoring).
|
| + 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);
|
|
|