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

Unified Diff: chrome/browser/ui/webui/welcome_win10_ui.cc

Issue 2659643003: Set kHasSeenWin10PromoPage in local_state instead of in profile prefs. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/welcome_win10_ui.cc
diff --git a/chrome/browser/ui/webui/welcome_win10_ui.cc b/chrome/browser/ui/webui/welcome_win10_ui.cc
index cf416e30e2e22d7db852d3c33e6e5510d548bf74..9482848097dcba6bee0b2f84a72644dc9131e81e 100644
--- a/chrome/browser/ui/webui/welcome_win10_ui.cc
+++ b/chrome/browser/ui/webui/welcome_win10_ui.cc
@@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/startup/startup_features.h"
#include "chrome/browser/ui/webui/welcome_win10_handler.h"
@@ -92,10 +93,9 @@ WelcomeWin10UI::WelcomeWin10UI(content::WebUI* web_ui, const GURL& url)
static const char kCssFilePath[] = "welcome.css";
static const char kJsFilePath[] = "welcome.js";
- Profile* profile = Profile::FromWebUI(web_ui);
-
- // Store that this profile has been shown the Win10 promo page.
- profile->GetPrefs()->SetBoolean(prefs::kHasSeenWin10PromoPage, true);
+ // Remember that the Win10 promo page has been shown.
+ g_browser_process->local_state()->SetBoolean(prefs::kHasSeenWin10PromoPage,
+ true);
// Determine which variation to show.
bool is_first_run = !UrlContainsKeyValueInQuery(url, "text", "faster");
@@ -122,6 +122,7 @@ WelcomeWin10UI::WelcomeWin10UI(content::WebUI* web_ui, const GURL& url)
html_source->AddResourcePath("logo-small.png", IDR_PRODUCT_LOGO_64);
html_source->AddResourcePath("logo-large.png", IDR_PRODUCT_LOGO_128);
+ Profile* profile = Profile::FromWebUI(web_ui);
Peter Kasting 2017/01/26 21:14:32 Nit: Or just inline this
Patrick Monette 2017/01/26 22:09:13 Done.
content::WebUIDataSource::Add(profile, html_source);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698