Commit 005c16e1 authored by Dominick Ng's avatar Dominick Ng Committed by Commit Bot

Add a method to query if an app is installable in the Play Store.

This CL adds a new method on app.mojom that allows Chrome OS to query
ARC for whether a given package name is currently installable.

BUG=969560

Change-Id: Ia525a92944b9b4afb4fd5f6a1ccb150e931a22ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1640917Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666171}
parent eae31e4c
......@@ -354,7 +354,7 @@ interface AppHost {
};
// TODO(lhchavez): Migrate all request/response messages to Mojo.
// Next method ID: 34
// Next method ID: 35
// Deprecated method IDs: 2, 3, 13
interface AppInstance {
// DEPRECATED: Please use Init@21 instead.
......@@ -492,4 +492,10 @@ interface AppInstance {
[MinVersion=37] RequestAssistStructure@29() =>
(ax.mojom.AssistantExtra? assistant_extra,
ax.mojom.AssistantTree? assistant_tree);
// Queries whether |package_name| is installable for the current user. This
// may return false if the user has already installed |package_name|, or if
// it isn't available in the user's store.
[MinVersion=43] IsInstallable@34(string package_name) =>
(bool is_installable);
};
......@@ -485,6 +485,11 @@ void FakeAppInstance::RequestAssistStructure(
std::move(callback).Run(nullptr, nullptr);
}
void FakeAppInstance::IsInstallable(const std::string& package_name,
IsInstallableCallback callback) {
std::move(callback).Run(false);
}
void FakeAppInstance::LaunchIntentDeprecated(
const std::string& intent_uri,
const base::Optional<gfx::Rect>& dimension_on_screen) {
......
......@@ -159,6 +159,8 @@ class FakeAppInstance : public mojom::AppInstance {
void StartFastAppReinstallFlow(
const std::vector<std::string>& package_names) override;
void RequestAssistStructure(RequestAssistStructureCallback callback) override;
void IsInstallable(const std::string& package_name,
IsInstallableCallback callback) override;
// Methods to reply messages.
void SendRefreshAppList(const std::vector<mojom::AppInfo>& apps);
......
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