Commit 9b1ec672 authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

[consent toggle] Modify playstore search conditions.

After some discussion, we have decided that if the suggested content
toggle is not present, then playstore recommendations will still be
enabled.
This change modifies the logic so that we disable playstore search only
if both the following conditions are met:
(a) The suggested content toggle feature is enabled,
(b) The suggested content pref is disabled.

Bug: 1079169
Change-Id: I15d542bec594b6ce3bdc8449fc09db1da43e9472
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249280Reviewed-by: default avatarJia Meng <jiameng@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779193}
parent 116d91ee
......@@ -105,16 +105,15 @@ void ArcPlayStoreSearchProvider::Start(const base::string16& query) {
// Always check if suggested content is enabled before searching for play
// store apps.
PrefService* pref_service = profile_->GetPrefs();
bool is_suggested_content_enabled =
bool is_suggested_content_toggle_enabled =
base::FeatureList::IsEnabled(chromeos::features::kSuggestedContentToggle);
if (is_suggested_content_enabled && pref_service) {
is_suggested_content_enabled =
if (is_suggested_content_toggle_enabled && pref_service) {
bool is_suggested_content_enabled =
pref_service->GetBoolean(chromeos::prefs::kSuggestedContentEnabled);
if (!is_suggested_content_enabled)
return;
}
if (!is_suggested_content_enabled)
return;
last_query_ = query;
// Clear any results from the previous query.
......
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