Commit 1ba024ed authored by Thanh Nguyen's avatar Thanh Nguyen Committed by Commit Bot

Add suggested content toggle for Dinner for one

This CL adds suggested content toggle for dinner for one.

Bug: 1028373
Change-Id: Iafae0bceaaecfd72dec37f983b18a35f06b5fcb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426215
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Reviewed-by: default avatarRachel Wong <wrong@chromium.org>
Reviewed-by: default avatarTony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810495}
parent 9234f907
......@@ -22,6 +22,7 @@
#include "chrome/browser/ui/app_list/search/chrome_search_result.h"
#include "chrome/browser/ui/app_list/search/common/url_icon_source.h"
#include "chrome/common/pref_names.h"
#include "chromeos/constants/chromeos_pref_names.h"
#include "components/arc/arc_service_manager.h"
#include "components/arc/session/arc_bridge_service.h"
#include "components/pref_registry/pref_registry_syncable.h"
......@@ -250,10 +251,21 @@ ash::AppListSearchResultType ArcAppReinstallSearchProvider::ResultType() {
}
void ArcAppReinstallSearchProvider::Start(const base::string16& query) {
if (query_is_empty_ == query.empty())
query_is_empty_ = query.empty();
if (!query_is_empty_) {
ClearResults();
return;
}
// Always check if suggested content is enabled before searching for
// reinstall recommendations.
PrefService* pref_service = profile_->GetPrefs();
if (pref_service &&
!pref_service->GetBoolean(chromeos::prefs::kSuggestedContentEnabled)) {
ClearResults();
return;
}
query_is_empty_ = query.empty();
UpdateResults();
}
......
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