NUX Onboarding: create landing page skeleton.
This CL also adds a helper function to check if the NUX onboarding feature
should be force-enabled on non-win/non-branded builds. This will make
testing and development for the feature much easier. There will be follow-up
CLs to transition all NUX contents to be behind this flag instead of the
build flags.
To test this, add --enable-features=NuxOnboardingForceEnabled
Bug: 874142
Change-Id: I0c1ae6d396901b0a7cbb1c13fe158b488ff0e14c
Reviewed-on: https://chromium-review.googlesource.com/1229502
Reviewed-by: Hector Carmona <[email protected]>
Reviewed-by: Demetrios Papadopoulos <[email protected]>
Commit-Queue: Scott Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#593017}
diff --git a/chrome/browser/ui/webui/welcome_ui.cc b/chrome/browser/ui/webui/welcome_ui.cc
index 5bade86..aa732e7 100644
--- a/chrome/browser/ui/webui/welcome_ui.cc
+++ b/chrome/browser/ui/webui/welcome_ui.cc
@@ -10,6 +10,7 @@
#include "build/build_config.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
+#include "chrome/browser/ui/webui/welcome/nux_helper.h"
#include "chrome/browser/ui/webui/welcome_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/browser_resources.h"
@@ -68,9 +69,18 @@
html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128);
html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256);
- // Use special layout if the application is branded and DICE is enabled.
- // Otherwise use the default layout.
- if (kIsBranded && is_dice) {
+ if (nux::IsNuxOnboardingEnabled()) {
+ // Add Onboarding welcome strings.
+ html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
+
+ // Add onboarding welcome resources.
+ // TODO(scottchen): More resources to be added here.
+ html_source->SetDefaultResource(
+ IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_HTML);
+
+ } else if (kIsBranded && is_dice) {
+ // Use special layout if the application is branded and DICE is enabled.
+ // Otherwise use the default layout.
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
html_source->AddLocalizedString("secondHeaderText",
IDS_DICE_WELCOME_SECOND_HEADER);