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

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

Issue 2449853008: Determine the Win10-specific Welcome page variant to display (Closed)
Patch Set: More nits 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
« no previous file with comments | « chrome/browser/ui/webui/welcome_win10_handler.cc ('k') | 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 bf8c85032098fe9f57f383b9b9c010b4eb4ce22c..883415b9fe4f045c33bdf823af6e075e11ffe377 100644
--- a/chrome/browser/ui/webui/welcome_win10_ui.cc
+++ b/chrome/browser/ui/webui/welcome_win10_ui.cc
@@ -6,7 +6,9 @@
#include <string>
+#include "base/feature_list.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/startup/startup_features.h"
#include "chrome/browser/ui/webui/welcome_win10_handler.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
@@ -31,6 +33,18 @@ bool UrlContainsKeyValueInQuery(const GURL& url,
value == expected_value;
}
+bool ShouldShowInlineStyleVariant(const GURL& url) {
+ // Can be overridden via a query.
+ // TODO(pmonette): Remove these checks when they are no longer needed
+ // (crbug.com/658918).
+ if (UrlContainsKeyValueInQuery(url, "style", "inline"))
+ return true;
+ if (UrlContainsKeyValueInQuery(url, "style", "sectioned"))
+ return false;
+
+ return base::FeatureList::IsEnabled(features::kWelcomeWin10InlineStyle);
+}
+
// Adds all the needed localized strings to |html_source|, depending on
// the value of |is_first_run|.
void AddLocalizedStrings(content::WebUIDataSource* html_source,
@@ -82,7 +96,7 @@ WelcomeWin10UI::WelcomeWin10UI(content::WebUI* web_ui, const GURL& url)
// Determine which variation to show.
bool is_first_run = !UrlContainsKeyValueInQuery(url, "text", "faster");
- bool is_inline_style = UrlContainsKeyValueInQuery(url, "style", "inline");
+ bool is_inline_style = ShouldShowInlineStyleVariant(url);
AddLocalizedStrings(html_source, is_first_run);
« no previous file with comments | « chrome/browser/ui/webui/welcome_win10_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698