Commit 3314ef5a authored by Yue Cen's avatar Yue Cen Committed by Commit Bot

FAR screen should be only shown to first-time Chromebook user.

Please see b/114134918 for more details.

Bug: 835029
Change-Id: Iefeffe6c9d0335aa61c24097b190092a3a657fbd
Reviewed-on: https://chromium-review.googlesource.com/1213521
Commit-Queue: Yue Cen <rsgingerrs@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarStefan Kuhne <skuhne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590168}
parent 293a9ca2
...@@ -272,9 +272,12 @@ bool NetworkAllowUpdate(const chromeos::NetworkState* network) { ...@@ -272,9 +272,12 @@ bool NetworkAllowUpdate(const chromeos::NetworkState* network) {
return true; return true;
} }
// Return true if the feature flag for recommend app screen is on. // Return true if the feature flag for recommend app screen is on and the screen
// is never triggered before.
bool ShouldShowRecommendAppsScreen() { bool ShouldShowRecommendAppsScreen() {
return base::FeatureList::IsEnabled(features::kOobeRecommendAppsScreen); return base::FeatureList::IsEnabled(features::kOobeRecommendAppsScreen) &&
!ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
prefs::kOobeRecommendAppScreenFinished);
} }
chromeos::LoginDisplayHost* GetLoginDisplayHost() { chromeos::LoginDisplayHost* GetLoginDisplayHost() {
...@@ -1122,7 +1125,7 @@ void WizardController::OnArcTermsOfServiceAccepted() { ...@@ -1122,7 +1125,7 @@ void WizardController::OnArcTermsOfServiceAccepted() {
return; return;
} }
// If the feature flag for recommend app screen is on, show it after the user // If the recommend app screen should be shown, show it after the user
// finished with the PlayStore Terms of Service. Otherwise, advance to the // finished with the PlayStore Terms of Service. Otherwise, advance to the
// assistant opt-in flow screen. // assistant opt-in flow screen.
if (ShouldShowRecommendAppsScreen()) { if (ShouldShowRecommendAppsScreen()) {
......
...@@ -421,6 +421,9 @@ void ProfileImpl::RegisterProfilePrefs( ...@@ -421,6 +421,9 @@ void ProfileImpl::RegisterProfilePrefs(
registry->RegisterIntegerPref(prefs::kPrintingColorDefault, 0); registry->RegisterIntegerPref(prefs::kPrintingColorDefault, 0);
registry->RegisterIntegerPref(prefs::kPrintingDuplexDefault, 0); registry->RegisterIntegerPref(prefs::kPrintingDuplexDefault, 0);
registry->RegisterDictionaryPref(prefs::kPrintingSizeDefault); registry->RegisterDictionaryPref(prefs::kPrintingSizeDefault);
registry->RegisterBooleanPref(
prefs::kOobeRecommendAppScreenFinished, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
#endif // BUILDFLAG(ENABLE_PRINTING) #endif // BUILDFLAG(ENABLE_PRINTING)
registry->RegisterBooleanPref(prefs::kPrintPreviewDisabled, false); registry->RegisterBooleanPref(prefs::kPrintPreviewDisabled, false);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/arc/arc_fast_app_reinstall_starter.h" #include "chrome/browser/ui/app_list/arc/arc_fast_app_reinstall_starter.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/component_extension_resources.h" #include "chrome/grit/component_extension_resources.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/arc/arc_prefs.h" #include "components/arc/arc_prefs.h"
...@@ -124,6 +125,8 @@ void RecommendAppsScreenHandler::Show() { ...@@ -124,6 +125,8 @@ void RecommendAppsScreenHandler::Show() {
Profile* profile = ProfileManager::GetActiveUserProfile(); Profile* profile = ProfileManager::GetActiveUserProfile();
pref_service_ = profile->GetPrefs(); pref_service_ = profile->GetPrefs();
profile->GetPrefs()->SetBoolean(prefs::kOobeRecommendAppScreenFinished, true);
} }
void RecommendAppsScreenHandler::Hide() {} void RecommendAppsScreenHandler::Hide() {}
......
...@@ -1862,6 +1862,10 @@ const char kOobeScreenPending[] = "OobeScreenPending"; ...@@ -1862,6 +1862,10 @@ const char kOobeScreenPending[] = "OobeScreenPending";
// and get enrolled into a domain automatically. // and get enrolled into a domain automatically.
const char kOobeControllerDetected[] = "OobeControllerDetected"; const char kOobeControllerDetected[] = "OobeControllerDetected";
// A boolean pref to indicate if the Recommend App screen in OOBE is finished
// for the user.
const char kOobeRecommendAppScreenFinished[] = "OobeRecommendAppScreenFinished";
// A boolean pref for whether the Goodies promotion webpage has been displayed, // A boolean pref for whether the Goodies promotion webpage has been displayed,
// or otherwise disqualified for auto-display, on this device. // or otherwise disqualified for auto-display, on this device.
const char kCanShowOobeGoodiesPage[] = "CanShowOobeGoodiesPage"; const char kCanShowOobeGoodiesPage[] = "CanShowOobeGoodiesPage";
......
...@@ -625,6 +625,7 @@ extern const char kInitialLocale[]; ...@@ -625,6 +625,7 @@ extern const char kInitialLocale[];
extern const char kOobeComplete[]; extern const char kOobeComplete[];
extern const char kOobeScreenPending[]; extern const char kOobeScreenPending[];
extern const char kOobeControllerDetected[]; extern const char kOobeControllerDetected[];
extern const char kOobeRecommendAppScreenFinished[];
extern const char kCanShowOobeGoodiesPage[]; extern const char kCanShowOobeGoodiesPage[];
extern const char kDeviceRegistered[]; extern const char kDeviceRegistered[];
extern const char kEnrollmentRecoveryRequired[]; extern const char kEnrollmentRecoveryRequired[];
......
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