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

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

Issue 1226643002: Welcome page changes for Windows 10 and over. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix RestoreOnStartupURLsPolicySpecified Created 5 years, 5 months 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_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 8103e208e2145bb205fba476f4540029cfd4c912..1ec4758806baa560406dc873dc9a9f6262433553 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.h
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.h
@@ -29,8 +29,18 @@ class WebContents;
}
namespace internals {
+
GURL GetWelcomePageURL();
-}
+
+// On Windows 10 and higher, the welcome page is shown once following each OS
+// upgrade, even when not in first-run. When this is true, the welcome page
gab 2015/07/09 18:05:13 "even when not" suggests it *may also* happen duri
grt (UTC plus 2) 2015/07/10 15:43:25 comment removed
+// precedes the NTP in the startup tabs, and the sync promo is not shown.
+bool ShowWelcomePageAfterFirstRun();
msw 2015/07/09 17:51:31 Inline this in StartupBrowserCreatorImpl::Initiali
grt (UTC plus 2) 2015/07/10 15:43:25 Done.
+
+// Records that welcome page was shown for the current run.
+void RecordWelcomeRunComplete();
+
+} // namespace internals
// Assists launching the application and appending the initial tabs for a
// browser window.
@@ -79,6 +89,13 @@ class StartupBrowserCreatorImpl {
FRIEND_TEST_ALL_PREFIXES(BrowserTest, RestorePinnedTabs);
FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
+ enum class WelcomeRunType {
+ NONE, // Do not inject the welcome page for this run.
+ FIRST_RUN_FIRST, // Inject the welcome page as the first first-run tab.
msw 2015/07/09 17:51:31 It doesn't seem like the enum needs to convey the
grt (UTC plus 2) 2015/07/09 18:59:38 I didn't differentiate these initially, but it tur
msw 2015/07/10 19:40:45 That sounds plausible, but I might have to see it
+ FIRST_RUN_LAST, // Inject the welcome page as the last first-run tab.
+ ANY_RUN_FIRST, // Inject the welcome page as the first tab.
+ };
+
// If the process was launched with the web application command line flags,
// e.g. --app=http://www.google.com/ or --app_id=... return true.
// In this case |app_url| or |app_id| are populated if they're non-null.
@@ -141,15 +158,22 @@ class StartupBrowserCreatorImpl {
// Adds additional startup URLs to the specified vector.
void AddStartupURLs(std::vector<GURL>* startup_urls) const;
- // Checks whether the Preferences backup is invalid and notifies user in
- // that case.
- void CheckPreferencesBackup(Profile* profile);
+ // Initializes |welcome_run_type_| for this launch. For first-run, the type
msw 2015/07/09 17:51:31 Don't explain the nuanced impl details here, move
grt (UTC plus 2) 2015/07/09 18:59:38 Done.
+ // will be LAST_TAB for all systems except for Windows 10+, where it will be
+ // FIRST_TAB. For non-first run, the type will be NONE for all systems
gab 2015/07/09 18:05:13 FIRST_TAB and LAST_TAB don't match the values of t
grt (UTC plus 2) 2015/07/09 18:59:38 Done.
+ // except for Windows 10+, where it will be FIRST_TAB if this is the first
+ // somewhat normal launch since an OS upgrade.
+ void InitializeWelcomeRunType(const std::vector<GURL>& urls_to_open);
+
+ // Records that the welcome page was shown.
+ void RecordWelcomeRunComplete() const;
const base::FilePath cur_dir_;
const base::CommandLine& command_line_;
Profile* profile_;
StartupBrowserCreator* browser_creator_;
bool is_first_run_;
+ WelcomeRunType welcome_run_type_;
DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl);
};

Powered by Google App Engine
This is Rietveld 408576698