Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3598)

Unified Diff: chrome/browser/ui/startup/startup_tab_provider.h

Issue 2457653003: Completing refactor of startup_browser_creator_impl (Closed)
Patch Set: Addressing pkasting comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/startup_tab_provider.h
diff --git a/chrome/browser/ui/startup/startup_tab_provider.h b/chrome/browser/ui/startup/startup_tab_provider.h
index 5100fd6ced7ffa0295496c59c3c7e8add404942a..0c24d83a52b418501e2f13281ce9eca7e8ec82a5 100644
--- a/chrome/browser/ui/startup/startup_tab_provider.h
+++ b/chrome/browser/ui/startup/startup_tab_provider.h
@@ -35,13 +35,19 @@ class StartupTabProvider {
// Reset on this profile. Returns any tabs which should be shown accordingly.
virtual StartupTabs GetResetTriggerTabs(Profile* profile) const = 0;
- // Returns the user's pinned tabs.
- virtual StartupTabs GetPinnedTabs(Profile* profile) const = 0;
+ // Returns the user's pinned tabs, if they should be shown.
+ virtual StartupTabs GetPinnedTabs(const base::CommandLine& command_line,
+ Profile* profile) const = 0;
// Returns tabs, if any, specified in the user's preferences as the default
// content for a new window.
virtual StartupTabs GetPreferencesTabs(const base::CommandLine& command_line,
Profile* profile) const = 0;
+
+ // Returns the New Tab Page, if the user's preferences indicate a
+ // configuration where it must be passed explicitly.
+ virtual StartupTabs GetNewTabPageTabs(const base::CommandLine& command_line,
+ Profile* profile) const = 0;
};
class StartupTabProviderImpl : public StartupTabProvider {
@@ -66,10 +72,20 @@ class StartupTabProviderImpl : public StartupTabProvider {
// of a Reset Trigger on this profile.
static StartupTabs CheckResetTriggerTabPolicy(bool profile_has_trigger);
+ // Determines whether the startup preference requires the contents of
+ // |pinned_tabs| to be shown. This is needed to avoid duplicates, as the
+ // session restore logic will also resurface pinned tabs on its own.
+ static StartupTabs CheckPinnedTabPolicy(const SessionStartupPref& pref,
+ const StartupTabs& pinned_tabs);
+
// Determines whether preferences indicate that user-specified tabs should be
// shown as the default new window content, and returns the specified tabs if
// so.
- static StartupTabs CheckPreferencesTabPolicy(SessionStartupPref pref);
+ static StartupTabs CheckPreferencesTabPolicy(const SessionStartupPref& pref);
+
+ // Determines whether startup preferences require the New Tab Page to be
+ // explicitly specified. Session Restore does not expect the NTP to be passed.
+ static StartupTabs CheckNewTabPageTabPolicy(const SessionStartupPref& pref);
// Gets the URL for the "Welcome to Chrome" page.
static GURL GetWelcomePageUrl();
@@ -83,9 +99,12 @@ class StartupTabProviderImpl : public StartupTabProvider {
StartupTabs GetDistributionFirstRunTabs(
StartupBrowserCreator* browser_creator) const override;
StartupTabs GetResetTriggerTabs(Profile* profile) const override;
- StartupTabs GetPinnedTabs(Profile* profile) const override;
+ StartupTabs GetPinnedTabs(const base::CommandLine& command_line,
+ Profile* profile) const override;
StartupTabs GetPreferencesTabs(const base::CommandLine& command_line,
Profile* profile) const override;
+ StartupTabs GetNewTabPageTabs(const base::CommandLine& command_line,
+ Profile* profile) const override;
private:
DISALLOW_COPY_AND_ASSIGN(StartupTabProviderImpl);
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl_unittest.cc ('k') | chrome/browser/ui/startup/startup_tab_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698