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

Unified Diff: chrome/browser/first_run/first_run.cc

Issue 2710073002: Never show the default browser prompt over the first run promos (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « chrome/browser/first_run/first_run.h ('k') | chrome/browser/ui/startup/default_browser_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run.cc
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index ca397ec6eb117bfe7b4c6600a2e1b225c69a642e..a13c299c3ac9743173c7146daf6fbc8d08dcc7da 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -326,27 +326,6 @@ void ConvertStringVectorToGURLVector(
std::transform(src.begin(), src.end(), ret->begin(), &UrlFromString);
}
-bool IsOnWelcomePage(content::WebContents* contents) {
- // We have to check both the GetURL() similar to the other checks below, but
- // also the original request url because the welcome page we use is a
- // redirect.
- // TODO(crbug.com/651465): Remove this once kUseConsolidatedStartupFlow is on
- // by default.
- const GURL deprecated_welcome_page(
- l10n_util::GetStringUTF8(IDS_WELCOME_PAGE_URL));
- if (contents->GetURL() == deprecated_welcome_page ||
- (contents->GetController().GetVisibleEntry() &&
- contents->GetController().GetVisibleEntry()->GetOriginalRequestURL() ==
- deprecated_welcome_page)) {
- return true;
- }
-
- const GURL welcome_page(chrome::kChromeUIWelcomeURL);
- const GURL welcome_page_win10(chrome::kChromeUIWelcomeWin10URL);
- const GURL current = contents->GetURL().GetWithEmptyPath();
- return current == welcome_page || current == welcome_page_win10;
-}
-
// Show the first run search engine bubble at the first appropriate opportunity.
// This bubble may be delayed by other UI, like global errors and sync promos.
class FirstRunBubbleLauncher : public content::NotificationObserver {
@@ -418,7 +397,7 @@ void FirstRunBubbleLauncher::Observe(
gaia::IsGaiaSignonRealm(contents->GetURL().GetOrigin()) ||
contents->GetURL() ==
chrome::GetSettingsUrl(chrome::kSyncSetupSubPage) ||
- IsOnWelcomePage(contents))) {
+ first_run::IsOnWelcomePage(contents))) {
return;
}
@@ -715,6 +694,27 @@ bool ShouldShowWelcomePage() {
return retval;
}
+bool IsOnWelcomePage(content::WebContents* contents) {
+ // We have to check both the GetURL() similar to the other checks below, but
+ // also the original request url because the welcome page we use is a
+ // redirect.
+ // TODO(crbug.com/651465): Remove this once kUseConsolidatedStartupFlow is on
+ // by default.
+ const GURL deprecated_welcome_page(
+ l10n_util::GetStringUTF8(IDS_WELCOME_PAGE_URL));
+ if (contents->GetURL() == deprecated_welcome_page ||
+ (contents->GetController().GetVisibleEntry() &&
+ contents->GetController().GetVisibleEntry()->GetOriginalRequestURL() ==
+ deprecated_welcome_page)) {
+ return true;
+ }
+
+ const GURL welcome_page(chrome::kChromeUIWelcomeURL);
+ const GURL welcome_page_win10(chrome::kChromeUIWelcomeWin10URL);
+ const GURL current = contents->GetURL().GetWithEmptyPath();
+ return current == welcome_page || current == welcome_page_win10;
+}
+
void SetShouldDoPersonalDataManagerFirstRun() {
g_should_do_autofill_personal_data_manager_first_run = true;
}
« no previous file with comments | « chrome/browser/first_run/first_run.h ('k') | chrome/browser/ui/startup/default_browser_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698