Commit 96a104f4 authored by Jia's avatar Jia Committed by Commit Bot

[Cros SR] Add ArcAppShortcut as a search result type

Bug: 931149
Change-Id: I2b5007ad211eeb785091662257f34fa1ce89f44f
Reviewed-on: https://chromium-review.googlesource.com/c/1480307Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jia Meng <jiameng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634350}
parent 183383d2
......@@ -115,6 +115,8 @@ struct EnumTraits<ash::mojom::SearchResultType, ash::SearchResultType> {
return ash::mojom::SearchResultType::kAnswerCard;
case ash::SearchResultType::kPlayStoreReinstallApp:
return ash::mojom::SearchResultType::kPlayStoreReinstallApp;
case ash::SearchResultType::kArcAppShortcut:
return ash::mojom::SearchResultType::kArcAppShortcut;
case ash::SearchResultType::kUnknown:
break;
}
......@@ -155,6 +157,9 @@ struct EnumTraits<ash::mojom::SearchResultType, ash::SearchResultType> {
case ash::mojom::SearchResultType::kPlayStoreReinstallApp:
*out = ash::SearchResultType::kPlayStoreReinstallApp;
return true;
case ash::mojom::SearchResultType::kArcAppShortcut:
*out = ash::SearchResultType::kArcAppShortcut;
return true;
}
NOTREACHED();
return false;
......
......@@ -48,6 +48,7 @@ enum class SearchResultType {
kLauncher, // Results from launcher search (currently only from Files).
kAnswerCard, // WebContents based answer card.
kPlayStoreReinstallApp, // Reinstall recommendations from PlayStore.
kArcAppShortcut, // ARC++ app shortcuts.
// Add new values here.
};
......
......@@ -121,6 +121,7 @@ enum SearchResultType {
kLauncher, // Results from launcher search (currently only from Files).
kAnswerCard, // WebContents based answer card.
kPlayStoreReinstallApp, // Reinstall recommendations from PlayStore.
kArcAppShortcut, // ARC++ app shortcuts.
// Add new values here.
};
......
......@@ -37,6 +37,7 @@ ArcAppShortcutSearchResult::ArcAppShortcutSearchResult(
set_id(kAppShortcutSearchPrefix + GetAppId() + "/" + data_->shortcut_id);
SetDisplayType(ash::SearchResultDisplayType::kTile);
SetAccessibleName(ComputeAccessibleName());
SetResultType(ash::SearchResultType::kArcAppShortcut);
const int icon_dimension =
app_list::AppListConfig::instance().search_tile_icon_dimension();
......
......@@ -30,6 +30,8 @@ RankingItemType RankingItemTypeFromSearchResultType(
case SearchResultType::kPlayStoreReinstallApp:
case SearchResultType::kWebStoreSearch:
return RankingItemType::kIgnored;
case SearchResultType::kArcAppShortcut:
return RankingItemType::kArcAppShortcut;
}
}
......
......@@ -21,6 +21,7 @@ enum class RankingItemType {
kFile,
kApp,
kOmnibox,
kArcAppShortcut
};
// Convert the enum used by |ChromeSearchResult|s into a |RankingItemType|.
......
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