Commit df8111a3 authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Store preferences for Help App state during OOBE.

We use this information to decide whether to show the Getting Started
module in the app, and which cards in the module to show.

Bug: b/151575693,b/151573827
Change-Id: I4f067a4c8b748e3e49804be650c5a7815e962379
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147164Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Commit-Queue: Rachel Carpenter <carpenterr@google.com>
Cr-Commit-Position: refs/heads/master@{#759043}
parent 42ea5016
......@@ -58,6 +58,13 @@ void LaunchApp(Profile* profile, std::string app_id) {
apps::AppServiceProxyFactory::GetForProfile(profile);
DCHECK(proxy);
// Any user for whom the Help app launches after OOBE should see the getting
// started module.
profile->GetPrefs()->SetBoolean(prefs::kHelpAppShouldShowGetStarted, true);
// This is only used by the getting started module, so we can set it here.
profile->GetPrefs()->SetBoolean(prefs::kHelpAppTabletModeDuringOobe,
ash::TabletMode::Get()->InTabletMode());
proxy->Launch(app_id, ui::EventFlags::EF_NONE,
apps::mojom::LaunchSource::kFromChromeInternal,
display::kInvalidDisplayId);
......@@ -107,6 +114,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
// users will always see the welcome app on a new device.
// See crbug.com/752361
registry->RegisterBooleanPref(prefs::kFirstRunTutorialShown, false);
registry->RegisterBooleanPref(prefs::kHelpAppShouldShowGetStarted, false);
registry->RegisterBooleanPref(prefs::kHelpAppTabletModeDuringOobe, false);
}
bool ShouldLaunchHelpApp(Profile* profile) {
......
......@@ -13,6 +13,7 @@
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/pref_names.h"
#include "chromeos/components/help_app_ui/url_constants.h"
#include "chromeos/services/multidevice_setup/public/cpp/prefs.h"
#include "chromeos/system/statistics_provider.h"
......@@ -58,6 +59,13 @@ void ChromeHelpAppUIDelegate::PopulateLoadTimeData(
Profile* profile = Profile::FromWebUI(web_ui_);
PrefService* pref_service = profile->GetPrefs();
// Add state from the OOBE flow.
source->AddBoolean(
"shouldShowGetStarted",
pref_service->GetBoolean(prefs::kHelpAppShouldShowGetStarted));
source->AddBoolean(
"tabletModeDuringOOBE",
pref_service->GetBoolean(prefs::kHelpAppTabletModeDuringOobe));
// Checks if any of the MultiDevice features (e.g. Instant Tethering,
// Messages, Smart Lock) is allowed on this device.
source->AddBoolean(
......
......@@ -2171,7 +2171,6 @@ const char kOobeComplete[] = "OobeComplete";
// The name of the screen that has to be shown if OOBE has been interrupted.
const char kOobeScreenPending[] = "OobeScreenPending";
// A boolean pref to indicate if the marketing opt-in screen in OOBE is finished
// for the user.
const char kOobeMarketingOptInScreenFinished[] =
......@@ -2188,6 +2187,14 @@ const char kDeviceRegistered[] = "DeviceRegistered";
// enrollment recovery flow upon next boot.
const char kEnrollmentRecoveryRequired[] = "EnrollmentRecoveryRequired";
// Pref name for whether we should show the Getting Started module in the Help
// app.
const char kHelpAppShouldShowGetStarted[] = "help_app.should_show_get_started";
// Pref name for whether the device was in tablet mode when going through
// the OOBE.
const char kHelpAppTabletModeDuringOobe[] = "help_app.tablet_mode_during_oobe";
// List of usernames that used certificates pushed by policy before.
// This is used to prevent these users from joining multiprofile sessions.
const char kUsedPolicyCertificates[] = "policy.used_policy_certificates";
......
......@@ -699,6 +699,8 @@ extern const char kOobeMarketingOptInScreenFinished[];
extern const char kCanShowOobeGoodiesPage[];
extern const char kDeviceRegistered[];
extern const char kEnrollmentRecoveryRequired[];
extern const char kHelpAppShouldShowGetStarted[];
extern const char kHelpAppTabletModeDuringOobe[];
extern const char kUsedPolicyCertificates[];
extern const char kServerBackedDeviceState[];
extern const char kCustomizationDefaultWallpaperURL[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment