Commit ca0380d5 authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

Filter search box text changes by result type rather than id.

Bug: 1112714
Change-Id: I19e39200262e0a8c44683cc9f92bca3b34dc9cb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359879Reviewed-by: default avatarXiyuan Slow <xiyuan@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803738}
parent c06d5907
......@@ -33,6 +33,7 @@ PrivacyContainerView::PrivacyContainerView(AppListViewDelegate* view_delegate)
auto metadata = std::make_unique<SearchResultMetadata>();
metadata->id = "PrivacyInfoResult";
metadata->result_type = AppListSearchResultType::kInternalPrivacyInfo;
result_.SetMetadata(std::move(metadata));
// This container simply wraps around PrivacyInfoView.
......
......@@ -740,8 +740,8 @@ void SearchBoxView::ButtonPressed(views::Button* sender,
void SearchBoxView::UpdateSearchBoxTextForSelectedResult(
SearchResult* selected_result) {
// TODO(wrong): Filter by result type instead of id.
if (selected_result->id() == "PrivacyInfoResult") {
if (selected_result->result_type() ==
AppListSearchResultType::kInternalPrivacyInfo) {
// Privacy view should not change the search box text.
return;
}
......
......@@ -150,6 +150,7 @@ enum class AppListSearchResultType {
kDriveQuickAccessChip, // Drive file results in suggestion chips.
kAssistantChip, // Assistant results in suggestion chips.
kOsSettings, // OS settings results.
kInternalPrivacyInfo, // Result used internally by privacy notices.
// Add new values here.
};
......
......@@ -32,6 +32,7 @@ RankingItemType RankingItemTypeFromSearchResult(
case ash::AppListSearchResultType::kPlayStoreReinstallApp:
case ash::AppListSearchResultType::kAssistantChip:
case ash::AppListSearchResultType::kOsSettings:
case ash::AppListSearchResultType::kInternalPrivacyInfo:
// NOTE: We don't rank results of type kAssistantChip as the Assistant
// chip result, if present, is always shown in a dedicated slot.
return RankingItemType::kIgnored;
......
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