arc: [34/N] Move //{ => ash}/components/arc/mojom:mojom : batch 8
This CL moves the 8th/last batch of files for
{ => ash}/components/arc/mojom:mojom
This CL moves the last few mojom files from this dependency tree.
https://graphviz.corp.google.com/png?graph_id=64927213e30088a9c248b15d84c5aefc
A follow-up CL will remove target //components/arc/mojom:mojom.
This is part of the LaCrOs directory migration
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE
Bug: b:129295708
Bug: 1164001
Test: CI
Change-Id: I9d98fbfa8f6e035f5398ff43b7d96793fa9391b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3309955
Reviewed-by: James Cook <jamescook@chromium.org>
Owners-Override: James Cook <jamescook@chromium.org>
Commit-Queue: Yao Li <yaohuali@google.com>
Cr-Commit-Position: refs/heads/main@{#947779}
NOKEYCHECK=True
GitOrigin-RevId: 2d6f802ada544ccf39e5803eb7e4c09a02a43674
diff --git a/BUILD.gn b/BUILD.gn
index b675d61..9d4d9f7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -10,17 +10,8 @@
# inclusion is done through read_file(), which does not respect the global
# defines for GN, so it itself cannot use the "is_chromeos" variable.
if (is_chromeos_ash) {
+ # TODO(b:129295708): Remove this target in next CL.
mojom("mojom") {
- sources = [
- "app.mojom",
- "app_permissions.mojom",
- "compatibility_mode.mojom",
- "file_system.mojom",
- "intent_common.mojom",
- "intent_helper.mojom",
- "scale_factor.mojom",
- ]
-
public_deps = [
"//ash/components/arc/mojom:camera_intent",
"//ash/components/arc/mojom:media",
@@ -40,53 +31,5 @@
"//ui/gfx/geometry/mojom",
"//url/mojom:url_mojom_gurl",
]
-
- cpp_typemaps = [
- {
- types = [
- {
- mojom = "arc.mojom.AppDiscoveryRequestState"
- cpp = "::arc::ArcPlayStoreSearchRequestState"
- },
- ]
- traits_headers = [ "app_mojom_traits.h" ]
- },
- {
- types = [
- {
- mojom = "arc.mojom.ChangeType"
- cpp = "::storage::WatcherManager::ChangeType"
- },
- ]
- traits_headers =
- [ "//components/arc/file_system/file_system_mojom_traits.h" ]
- traits_sources =
- [ "//components/arc/file_system/file_system_mojom_traits.cc" ]
- traits_public_deps = [ "//storage/browser" ]
- },
- {
- types = [
- {
- mojom = "arc.mojom.IntentFilter"
- cpp = "::arc::IntentFilter"
- move_only = true
- },
- {
- mojom = "arc.mojom.AuthorityEntry"
- cpp = "::arc::IntentFilter::AuthorityEntry"
- move_only = true
- },
- {
- mojom = "arc.mojom.PatternMatcher"
- cpp = "::arc::IntentFilter::PatternMatcher"
- move_only = true
- },
- ]
- traits_headers =
- [ "//components/arc/intent_helper/intent_filter_mojom_traits.h" ]
- traits_sources =
- [ "//components/arc/intent_helper/intent_filter_mojom_traits.cc" ]
- },
- ]
}
}
diff --git a/app.mojom b/app.mojom
deleted file mode 100644
index c0a36f9..0000000
--- a/app.mojom
+++ /dev/null
@@ -1,532 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Next MinVersion: 50
-
-module arc.mojom;
-
-import "components/arc/mojom/app_permissions.mojom";
-import "components/arc/mojom/compatibility_mode.mojom";
-import "ash/components/arc/mojom/gfx.mojom";
-import "components/arc/mojom/scale_factor.mojom";
-import "ui/accessibility/mojom/ax_assistant_structure.mojom";
-
-// Describes installation result.
-struct InstallationResult {
- string package_name;
- bool success; // true if app was installed successfully.
-};
-
-// Describes ARC app.
-struct AppInfo {
- string name;
- string package_name;
- string activity;
- [MinVersion=2] bool sticky; // true if the app cannot be uninstalled
- [MinVersion=7] bool notifications_enabled;
- [MinVersion=35] bool suspended;
- [MinVersion=47] ArcResizeLockState resize_lock_state;
-};
-
-// Describes the data required to install a web app.
-struct WebAppInfo {
- string title;
-
- // The URL which should be opened when the web app starts.
- string start_url;
-
- // The scope of URLs which are captured by the web app.
- string scope_url;
-
- // The color used for the title bar of the app. Passed as a 32 bit ARGB value.
- // INT_MAX+1 represents an invalid color.
- int64 theme_color;
-
- // If the web app is tied to a web-only TWA.
- [MinVersion=44] bool is_web_only_twa;
-
- // SHA256 fingerprint of the APK the web app belongs to.
- [MinVersion=45] string? certificate_sha256_fingerprint;
-};
-
-// Describes ARC package.
-struct ArcPackageInfo {
- string package_name;
- int32 package_version;
- int64 last_backup_android_id;
- int64 last_backup_time;
- bool sync; // true if package installation should be synced
- [MinVersion=11] bool system; // true if package is system package.
- // true if package registers VPNService intent.
- [MinVersion=25] bool vpn_provider;
-
- // If non-null, signifies this package represents a web app that should be
- // installed on the browser side.
- [MinVersion=38] WebAppInfo? web_app_info;
-
- // Deprecated in favour of |permission_states|
- [MinVersion=41] map<AppPermission, bool>? permissions;
-
- [MinVersion=43] map<AppPermission, PermissionState>? permission_states;
-};
-
-// Describes ARC app shortcut.
-struct ShortcutInfo {
- string name;
- string package_name;
- string icon_resource_id;
- string intent_uri;
-};
-
-// Page for ShowPackageInfoOnPage.
-[Extensible]
-enum ShowPackageInfoPage {
- // The main package info page.
- MAIN = 0,
-
- // Page for managing links assigned to the app.
- MANAGE_LINKS = 1,
-};
-
-// Describes the raw icon png data published by an Android application.
-struct RawIconPngData {
- // True if the icon is an adaptive icon, or false otherwise.
- bool is_adaptive_icon;
- // The raw icon for the non-adaptive icon, or the generated standard icon done
- // by the ARC side for the adaptive icon.
- array<uint8>? icon_png_data;
- // The foreground image for the adaptive icon.
- array<uint8>? foreground_icon_png_data;
- // The background image for the adaptive icon.
- array<uint8>? background_icon_png_data;
-};
-
-// The window information to launch an app.
-// This should be kept in sync with WindowInfo in
-// components/services/app_service/public/mojom/types.mojom, and
-// MakeArcWindowInfo in chrome/browser/apps/app_service/launch_utils.cc
-struct WindowInfo {
- int32 window_id = -1;
- int32 state = 0;
- int64 display_id = -1;
- Rect? bounds;
-};
-
-// Describes a Play Store app discovery result.
-struct AppDiscoveryResult {
- string? launch_intent_uri;
- string? install_intent_uri;
- string? label;
- bool is_instant_app;
- bool is_recent;
- string? publisher_name;
- string? formatted_price;
- float review_score;
- array<uint8> icon_png_data;
- [MinVersion=22] string? package_name;
- [MinVersion=46] RawIconPngData? icon;
-};
-
-// Describes the status of an app discovery request, including completed
-// states and all possible anomalies.
-[Extensible]
-enum AppDiscoveryRequestState {
- // Request handled successfully.
- SUCCESS = 0,
- // Request canceled when a newer request is sent.
- CANCELED = 1,
- // Request failed due to any communication error or Play Store internal error.
- ERROR_DEPRECATED = 2,
-
- // All possible reasons of ending a request:
- // PlayStoreProxyService is not available.
- PLAY_STORE_PROXY_NOT_AVAILABLE = 3,
- // It fails to cancel the previous request.
- FAILED_TO_CALL_CANCEL = 4,
- // It fails to call findApps API.
- FAILED_TO_CALL_FINDAPPS = 5,
- // It comes with invalid parameters.
- REQUEST_HAS_INVALID_PARAMS = 6,
- // It times out.
- REQUEST_TIMEOUT = 7,
- // At least one result returned from Phonesky has an unmatched request code.
- PHONESKY_RESULT_REQUEST_CODE_UNMATCHED = 8,
- // At least one result returned from Phonesky has an unmatched session id.
- PHONESKY_RESULT_SESSION_ID_UNMATCHED = 9,
- // Phonesky returns with an unmatched request code.
- PHONESKY_REQUEST_REQUEST_CODE_UNMATCHED = 10,
- // The app discovery service is not available.
- PHONESKY_APP_DISCOVERY_NOT_AVAILABLE = 11,
- // The installed Phonesky version doesn't support app discovery.
- PHONESKY_VERSION_NOT_SUPPORTED = 12,
- // It gets an unexpected exception from Phonesky.
- PHONESKY_UNEXPECTED_EXCEPTION = 13,
- // The Phonesky app discovery service thinks it's malformed.
- PHONESKY_MALFORMED_QUERY = 14,
- // An internal error happens in Phonesky while processing the request.
- PHONESKY_INTERNAL_ERROR = 15,
- // At least one result returned with invalid app data.
- PHONESKY_RESULT_INVALID_DATA = 16,
-};
-
-// Describes the category type of app shortcut item.
-[Extensible]
-enum AppShortcutItemType {
- // Static shortcut, which means it was published from AndroidManifest.xml.
- kStatic = 0,
-
- // Dynamic shortcut, which means it was published at runtime using the
- // ShortcutManagerAPI. Dynamic shortcuts are links to specific,
- // context-sensitive actions within the app.
- kDynamic = 1,
-};
-
-[Extensible]
-enum AppReinstallState {
- // Request and response successful.
- REQUEST_SUCCESS = 0,
- // Request Timeout
- REQUEST_TIMEOUT = 1,
- // No Account.
- REQUEST_NO_ACCOUNT = 2,
- // Null data from aidl.
- REQUEST_NULL_DATA = 3,
- // Data that can't be converted from aidl bundle to mojom struct.
- REQUEST_BUNDLE_ERROR = 4,
- // Request failure other reason.
- REQUEST_UNKNOWN_FAILURE = 5,
-};
-
-// Describes app reinstall candidates that are shown to users as suggestions.
-struct AppReinstallCandidate {
- // The package name of this in the Play Store.
- string package_name;
-
- // The title of this package in the Play Store.
- string title;
-
- // The url of an icon for this package. Optional, a default icon is used if
- // unset.
- string? icon_url;
-
- // Ratings Count from Play Store for this package. e.g. "17103" .
- // Default of 0 if not set.
- int64 rating_count;
-
- // Mean star rating for this package, [1, 5]. 0 indicates missing.
- float star_rating;
-};
-
-// Describes app shortcut that is published by Android's ShortcutManager.
-struct AppShortcutItem {
- // The ID of this shortcut. Unique within each publisher app and stable across
- // devices.
- string shortcut_id;
-
- // The short description of this shortcut.
- string short_label;
-
- // The icon for this shortcut, decoded in the utility process. This will be
- // replaced by |icon|.
- array<uint8> icon_png;
-
- // The package name of the publisher app.
- [MinVersion=31] string? package_name;
-
- // The category type of this shortcut.
- [MinVersion=32] AppShortcutItemType type;
-
- // "Rank" of a shortcut, which is a non-negative, sequential value.
- [MinVersion=32] int32 rank;
-
- // The icon for this shortcut, decoded in the utility process.
- [MinVersion=46] RawIconPngData? icon;
-};
-
-[Extensible]
-enum PaiFlowState {
- // PAI flow succeeded.
- SUCCEEDED = 0,
- // PAI flow state was not returned.
- UNKNOWN = 1,
- // PAI flow failed due to no account was provided.
- NO_ACCOUNT = 2,
- // PAI flow failed due Play Store returned no app to install.
- NO_APPS = 3,
- // PAI flow was interrupted.
- INTERRUPTED = 4,
- // PAI flow failed due to no response from Play Store.
- PLAY_STORE_NOT_RESPONDED = 5,
- // PAI flow failed due to no access to Play Store.
- PLAY_STORE_NO_ACCESS = 6,
- // PAI flow failed due to no ArcGmsProxy found.
- PROXY_NOT_FOUND = 7,
- // PAI flow failed due to no ArcGmsProxy access.
- PROXY_NO_ACCESS = 8,
- // PAI flow timeout occurred.
- TIMEOUT = 9,
-};
-
-// Next method ID: 19
-// Deprecated method IDs: 1
-interface AppHost {
- // Sends newly added ARC app to Chrome. This message is sent when ARC receives
- // package added notification. Multiple apps may be added in the one package.
- [MinVersion=1] OnAppAddedDeprecated@2(AppInfo app);
-
- // Receives a list of available ARC apps to Chrome. Members of AppInfo must
- // contain non-empty string.
- OnAppListRefreshed@0(array<AppInfo> apps);
-
- // Notifies that a package has been added.
- [MinVersion=8] OnPackageAdded@8(ArcPackageInfo arcPackageInfo);
-
- // Notifies that a package list of apps has been updated.
- [MinVersion=14] OnPackageAppListRefreshed@13(string package_name,
- array<AppInfo> apps);
-
- // Receives a list of available ARC packages to Chrome. Members of
- // PackageInfo must contain non-empty string.
- [MinVersion=8] OnPackageListRefreshed@9(array<ArcPackageInfo> packages);
-
- // Notifies that a package has been modified.
- [MinVersion=8] OnPackageModified@10(ArcPackageInfo arcPackageInfo);
-
- // Sends removed ARC package to Chrome. |package_name| must contain non-empty
- // string. This message is sent when ARC receives package removed
- // notification. Removing one package can potentially remove more than one
- // app.
- [MinVersion=1] OnPackageRemoved@3(string package_name);
-
- // Sends information about newly created task |package_name| and |activity|
- // specifies launch activity and |intent| is initial intent used to start
- // new task. |session_id| is the window_id of |window_info| from app launch
- // parameters. |session_id| is -1 if the window_id is not set.
- [MinVersion=4] OnTaskCreated@4(int32 task_id@0,
- string package_name@1,
- string activity@2,
- [MinVersion=13] string? name@3,
- [MinVersion=15] string? intent@4,
- [MinVersion=48] int32 session_id@5);
-
- // Sends task label and icon. This is deprecated and will soon be replaced by
- // OnTaskDescriptionChanged().
- [MinVersion=19] OnTaskDescriptionUpdated@17(int32 task_id,
- string label,
- array<uint8> icon_png_data);
-
- // Sends task label and icon.
- [MinVersion=46] OnTaskDescriptionChanged@18(
- int32 task_id,
- string label,
- RawIconPngData icon,
- [MinVersion=49] uint32 primary_color,
- [MinVersion=49] uint32 status_bar_color);
-
- // Notifies that task has been destroyed.
- [MinVersion=4] OnTaskDestroyed@5(int32 task_id);
-
- // Notifies that task has been activated.
- [MinVersion=4] OnTaskSetActive@6(int32 task_id);
-
- // Notifies that notifications enabled settings in Android is changed.
- [MinVersion=7] OnNotificationsEnabledChanged@7(string package_name,
- bool enabled);
-
- // Notifies that an application shortcut needs to be created.
- [MinVersion=9] OnInstallShortcut@11(ShortcutInfo shortcut);
-
- // Notifies that Play Store installation has been started. |package_name|
- // specifies installation package
- [MinVersion=16] OnInstallationStarted@14(
- [MinVersion=17] string? package_name@0);
-
- // Notifies that Play Store installation is finished. |result| contains
- // details of installation result.
- [MinVersion=16] OnInstallationFinished@15(
- [MinVersion=17] InstallationResult? result@1);
-
- // Notifies that an application shortcut needs to be deleted. Shortcut is
- // defined by its |intent_uri| and |package_name|.
- [MinVersion=18] OnUninstallShortcut@16(string package_name,
- string intent_uri);
-};
-
-// TODO(lhchavez): Migrate all request/response messages to Mojo.
-// Next method ID: 40
-// Deprecated method IDs: 0, 1, 2, 3, 4, 9, 12, 13, 15, 17, 22
-interface AppInstance {
- // DEPRECATED: Please use Init@21 instead.
- InitDeprecated@0(pending_remote<AppHost> host_remote);
-
- // Establishes full-duplex communication with the host.
- [MinVersion=26] Init@21(pending_remote<AppHost> host_remote) => ();
-
- [MinVersion=1] CanHandleResolutionDeprecated@4(
- string package_name, string activity, Rect dimension) =>
- (bool can_handle);
-
- // Closes the the given task.
- [MinVersion=4] CloseTask@8(int32 task_id);
-
- // Requests information about task.
- [MinVersion=3] GetTaskInfo@6(int32 task_id) => (string package_name,
- string activity);
-
- // Sends a request to ARC to install package.
- [MinVersion=8] InstallPackage@11(ArcPackageInfo arcPackageInfo);
-
- LaunchAppDeprecated@1(string package_name, string activity,
- [MinVersion=1] Rect? dimension_on_screen);
-
- // Sends a request to ARC to launch an ARC app defined by |package_name| and
- // |activity|, which cannot be empty.
- [MinVersion=23] LaunchApp@18(string package_name,
- string activity,
- int64 display_id);
-
- // Sends a request to ARC to launch an ARC app with specific launch window
- // info.
- [MinVersion=47] LaunchAppWithWindowInfo@38(string package_name,
- string activity,
- WindowInfo window_info);
-
- // Sends a request to ARC for the Android launcher to launch the specified app
- // shortcut.
- [MinVersion=30] LaunchAppShortcutItem@24(
- string package_name, string shortcut_id, int64 display_id);
-
- [MinVersion=9] LaunchIntentDeprecated@12(string intent_uri,
- Rect? dimension_on_screen);
-
- // Sends a request to ARC to launch an intent. The intent is encoded as a URI
- // string. See Intent.toUri().
- [MinVersion=23] LaunchIntent@19(string intent_uri,
- int64 display_id);
-
- // Sends a request to ARC to launch an ARC app with specific launch window
- // info.
- [MinVersion=47] LaunchIntentWithWindowInfo@39(string intent_uri,
- WindowInfo window_info);
-
- // Updates ghost window info to ARC.
- [MinVersion=49] UpdateWindowInfo@40(WindowInfo window_info);
-
- // Sends a request for the ARC icon of a given resource id and
- // |pixel_size|. This is deprecated and will soon be replaced by GetAppIcon().
- [MinVersion=36] RequestAppIcon@27(string package_name,
- string activity,
- int32 pixel_size) =>
- (array<uint8> icon_png_data);
-
- // Sends a request for the ARC icon of a given resource id and
- // |pixel_size|.
- [MinVersion=46] GetAppIcon@35(string package_name,
- string activity, int32 pixel_size) =>
- (RawIconPngData icon);
-
- // Sends a request for the ARC shortcut icon of a given resource id and
- // |pixel_size|. This is deprecated and will soon be replaced by
- // GetAppShortcutIcon().
- [MinVersion=36] RequestShortcutIcon@28(string icon_resource_id,
- int32 pixel_size) =>
- (array<uint8> icon_png_data);
-
- // Sends a request for the ARC shortcut icon of a given resource id and
- // |pixel_size|.
- [MinVersion=46] GetAppShortcutIcon@36(string icon_resource_id,
- int32 pixel_size) =>
- (RawIconPngData icon);
-
- // Sends a request for the ARC icon for a given |package_name| and
- // |pixel_size|. If |normalize| is true, the icon will be normalized per
- // Android's icon guidelines, otherwise, the raw unnormalized icon is
- // returned. Returns an empty array if an error occurred. This is deprecated
- // and will soon be replaced by GetPackageIcon().
- [MinVersion=38] RequestPackageIcon@30(string package_name,
- int32 pixel_size,
- bool normalize) =>
- (array<uint8> icon_png_data);
-
- // Sends a request for the ARC icon for a given |package_name| and
- // |pixel_size|. If |normalize| is true, the icon will be normalized per
- // Android's icon guidelines, otherwise, the raw unnormalized icon is
- // returned. Returns an empty array if an error occurred.
- [MinVersion=46] GetPackageIcon@37(string package_name,
- int32 pixel_size,
- bool normalize) =>
- (RawIconPngData icon);
-
- // Removes cached shortcut icon with the given resource id.
- [MinVersion=9] RemoveCachedIcon@14(string icon_resource_id);
-
- // Activates the given task and move it to foreground.
- [MinVersion=4] SetTaskActive@7(int32 task_id);
-
- [MinVersion=5] ShowPackageInfoDeprecated@9(string package_name,
- Rect dimension_on_screen);
-
- [MinVersion=10] ShowPackageInfoOnPageDeprecated@15(string package_name,
- ShowPackageInfoPage page,
- Rect dimension_on_screen);
-
- // Sends a request to ARC to show package info for given package on the
- // specified page.
- [MinVersion=23] ShowPackageInfoOnPage@20(string package_name,
- ShowPackageInfoPage page,
- int64 display_id);
-
- // Sets notification setting for the package.
- [MinVersion=6] SetNotificationsEnabled@10(string package_name, bool enabled);
-
- // Sends a request to ARC to start PAI flow and receives result status.
- [MinVersion=40] StartPaiFlow@32() => (PaiFlowState state);
-
- // Sends a request to ARC to start FastAppReinstall flow.
- [MinVersion=33] StartFastAppReinstallFlow@25(array<string> arc_package_names);
-
- // Sends a request to ARC to retrieve an array of app reinstall
- // candidates for this user on this device. Order of results is in an
- // unspecified order of relevance from Play Store.
- [MinVersion=39] GetAppReinstallCandidates@31() =>
- (AppReinstallState state, array<AppReinstallCandidate> candidates);
-
- // Sends a request to ARC to uninstall the given package. Error (if ever
- // happens) is ignored, and uninstall option should appear in the UI.
- [MinVersion=2] UninstallPackage@5(string package_name);
-
- // Returns Android instance id as it is registered on Google servers. 0 is
- // reserved for the case when Android instance id could not be determined,
- // however this should not normally happen once app instance is connected
- // after ARC provisioning that includes registering Android instance on
- // Google servers (known as initial Check-in flow).
- [MinVersion=42] GetAndroidId@33() => (int64 android_id);
-
- // Sends a request to ARC to get app shortcuts for apps in global scope that
- // match a |query|. Limits the results to only return |max_results|.
- [MinVersion=34] GetAppShortcutGlobalQueryItems@26(
- string query, int32 max_results) =>
- (array<AppShortcutItem> shortcut_items);
-
- // Sends a request to ARC to get app shortcuts for app with |package_name|.
- [MinVersion=29] GetAppShortcutItems@23(string package_name) =>
- (array<AppShortcutItem> shortcut_items);
-
- // Starts a query for Play Store apps.
- [MinVersion=20] GetRecentAndSuggestedAppsFromPlayStore@16(
- string query, int32 max_results) =>
- (AppDiscoveryRequestState state@1,
- array<AppDiscoveryResult> results@0);
-
- // Requests assist structure.
- [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);
-};
diff --git a/app_mojom_traits.h b/app_mojom_traits.h
deleted file mode 100644
index cfa23d0..0000000
--- a/app_mojom_traits.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_ARC_MOJOM_APP_MOJOM_TRAITS_H_
-#define COMPONENTS_ARC_MOJOM_APP_MOJOM_TRAITS_H_
-
-#include "components/arc/app/arc_playstore_search_request_state.h"
-#include "components/arc/mojom/app.mojom-shared.h"
-
-namespace mojo {
-
-template <>
-struct EnumTraits<arc::mojom::AppDiscoveryRequestState,
- arc::ArcPlayStoreSearchRequestState> {
- using ArcState = arc::ArcPlayStoreSearchRequestState;
- using MojoState = arc::mojom::AppDiscoveryRequestState;
-
- static MojoState ToMojom(ArcState input) {
- switch (input) {
- case ArcState::SUCCESS:
- return MojoState::SUCCESS;
- case ArcState::CANCELED:
- return MojoState::CANCELED;
- case ArcState::ERROR_DEPRECATED:
- return MojoState::ERROR_DEPRECATED;
- case ArcState::PLAY_STORE_PROXY_NOT_AVAILABLE:
- return MojoState::PLAY_STORE_PROXY_NOT_AVAILABLE;
- case ArcState::FAILED_TO_CALL_CANCEL:
- return MojoState::FAILED_TO_CALL_CANCEL;
- case ArcState::FAILED_TO_CALL_FINDAPPS:
- return MojoState::FAILED_TO_CALL_FINDAPPS;
- case ArcState::REQUEST_HAS_INVALID_PARAMS:
- return MojoState::REQUEST_HAS_INVALID_PARAMS;
- case ArcState::REQUEST_TIMEOUT:
- return MojoState::REQUEST_TIMEOUT;
- case ArcState::PHONESKY_RESULT_REQUEST_CODE_UNMATCHED:
- return MojoState::PHONESKY_RESULT_REQUEST_CODE_UNMATCHED;
- case ArcState::PHONESKY_RESULT_SESSION_ID_UNMATCHED:
- return MojoState::PHONESKY_RESULT_SESSION_ID_UNMATCHED;
- case ArcState::PHONESKY_REQUEST_REQUEST_CODE_UNMATCHED:
- return MojoState::PHONESKY_REQUEST_REQUEST_CODE_UNMATCHED;
- case ArcState::PHONESKY_APP_DISCOVERY_NOT_AVAILABLE:
- return MojoState::PHONESKY_APP_DISCOVERY_NOT_AVAILABLE;
- case ArcState::PHONESKY_VERSION_NOT_SUPPORTED:
- return MojoState::PHONESKY_VERSION_NOT_SUPPORTED;
- case ArcState::PHONESKY_UNEXPECTED_EXCEPTION:
- return MojoState::PHONESKY_UNEXPECTED_EXCEPTION;
- case ArcState::PHONESKY_MALFORMED_QUERY:
- return MojoState::PHONESKY_MALFORMED_QUERY;
- case ArcState::PHONESKY_INTERNAL_ERROR:
- return MojoState::PHONESKY_INTERNAL_ERROR;
- case ArcState::PHONESKY_RESULT_INVALID_DATA:
- return MojoState::PHONESKY_RESULT_INVALID_DATA;
- case ArcState::CHROME_GOT_INVALID_RESULT:
- case ArcState::STATE_COUNT:
- break;
- }
- NOTREACHED();
- return MojoState::SUCCESS;
- }
-
- static bool FromMojom(MojoState input, ArcState* out) {
- switch (input) {
- case MojoState::SUCCESS:
- *out = ArcState::SUCCESS;
- return true;
- case MojoState::CANCELED:
- *out = ArcState::CANCELED;
- return true;
- case MojoState::ERROR_DEPRECATED:
- *out = ArcState::ERROR_DEPRECATED;
- return true;
- case MojoState::PLAY_STORE_PROXY_NOT_AVAILABLE:
- *out = ArcState::PLAY_STORE_PROXY_NOT_AVAILABLE;
- return true;
- case MojoState::FAILED_TO_CALL_CANCEL:
- *out = ArcState::FAILED_TO_CALL_CANCEL;
- return true;
- case MojoState::FAILED_TO_CALL_FINDAPPS:
- *out = ArcState::FAILED_TO_CALL_FINDAPPS;
- return true;
- case MojoState::REQUEST_HAS_INVALID_PARAMS:
- *out = ArcState::REQUEST_HAS_INVALID_PARAMS;
- return true;
- case MojoState::REQUEST_TIMEOUT:
- *out = ArcState::REQUEST_TIMEOUT;
- return true;
- case MojoState::PHONESKY_RESULT_REQUEST_CODE_UNMATCHED:
- return true;
- *out = ArcState::PHONESKY_RESULT_REQUEST_CODE_UNMATCHED;
- return true;
- case MojoState::PHONESKY_RESULT_SESSION_ID_UNMATCHED:
- *out = ArcState::PHONESKY_RESULT_SESSION_ID_UNMATCHED;
- return true;
- case MojoState::PHONESKY_REQUEST_REQUEST_CODE_UNMATCHED:
- *out = ArcState::PHONESKY_REQUEST_REQUEST_CODE_UNMATCHED;
- return true;
- case MojoState::PHONESKY_APP_DISCOVERY_NOT_AVAILABLE:
- *out = ArcState::PHONESKY_APP_DISCOVERY_NOT_AVAILABLE;
- return true;
- case MojoState::PHONESKY_VERSION_NOT_SUPPORTED:
- *out = ArcState::PHONESKY_VERSION_NOT_SUPPORTED;
- return true;
- case MojoState::PHONESKY_UNEXPECTED_EXCEPTION:
- *out = ArcState::PHONESKY_UNEXPECTED_EXCEPTION;
- return true;
- case MojoState::PHONESKY_MALFORMED_QUERY:
- *out = ArcState::PHONESKY_MALFORMED_QUERY;
- return true;
- case MojoState::PHONESKY_INTERNAL_ERROR:
- *out = ArcState::PHONESKY_INTERNAL_ERROR;
- return true;
- case MojoState::PHONESKY_RESULT_INVALID_DATA:
- *out = ArcState::PHONESKY_RESULT_INVALID_DATA;
- return true;
- }
- NOTREACHED();
- return false;
- }
-};
-
-} // namespace mojo
-
-#endif // COMPONENTS_ARC_MOJOM_APP_MOJOM_TRAITS_H_
diff --git a/app_permissions.mojom b/app_permissions.mojom
deleted file mode 100644
index 0454b74..0000000
--- a/app_permissions.mojom
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Next MinVersion: 1
-
-module arc.mojom;
-
-// These permissions map to ones listed at
-// https://developer.android.com/reference/android/Manifest.permission
-[Extensible]
-enum AppPermission {
- CAMERA = 0, // android.manifest.CAMERA
- LOCATION = 1, // android.manifest.ACCESS_FINE_LOCATION or android.manifest.ACCESS_COARSE_LOCATION
- MICROPHONE = 2, // android.manifest.RECORD_AUDIO
- NOTIFICATIONS = 3, // Not a manifest permission
- CONTACTS = 4, // android.manifest.READ_CONTACTS and android.manifest.WRITE_CONTACTS
- STORAGE = 5, // android.manifest.WRITE_EXTERNAL_STORAGE and android.manifest.READ_EXTERNAL_STORAGE
-};
-
-struct PermissionState {
- bool granted; // If the permission has been granted
- bool managed; // If the permission is managed by an enterprise policy
-};
-
-// An interface for Chrome to manipulate app permissions in ARC.
-// Next method ID: 2
-interface AppPermissionsInstance {
- // Grants |permission| for |package_name|.
- GrantPermission@0(string package_name, AppPermission permission);
-
- // Revokes |permission| for |package_name|.
- RevokePermission@1(string package_name, AppPermission permission);
-};
diff --git a/compatibility_mode.mojom b/compatibility_mode.mojom
deleted file mode 100644
index 745373b..0000000
--- a/compatibility_mode.mojom
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2021 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Next MinVersion: 1
-
-module arc.mojom;
-
-// Contains the types of resize lock setting status that overrides the state
-// Android calculates.
-// These values are persisted to logs. Entries should not be renumbered and
-// numeric values should never be reused.
-[Extensible]
-enum ArcResizeLockState {
- // The setting value is not set.
- UNDEFINED = 0,
- // Resize lock is ready to be turned on. The state must have this value first
- // to be enabled.
- READY = 1,
- // Resize lock is enabled.
- ON = 2,
- // Resize lock is disabled via the Chrome OS settings.
- OFF = 3,
- // Resize lock is enabled, and even resize/resizability toggle is not
- // available.
- FULLY_LOCKED = 4,
-};
-
-// Interface for synchronizing the Chrome OS setting value for compatibility
-// mode to Android.
-// Compatibility mode is a special set of WM policies to enforce restrictions
-// on apps that are not optimized for large screens.
-// Next Method ID: 1
-interface CompatibilityModeInstance {
- // Synchronizes the resize lock state of the given package name to Android.
- SetResizeLockState@0(string package_name,
- ArcResizeLockState state);
-};
\ No newline at end of file
diff --git a/file_system.mojom b/file_system.mojom
deleted file mode 100644
index 341584a..0000000
--- a/file_system.mojom
+++ /dev/null
@@ -1,491 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Next MinVersion: 21
-
-module arc.mojom;
-
-import "ash/components/arc/mojom/bitmap.mojom";
-import "ash/components/arc/mojom/gfx.mojom";
-import "ash/components/arc/mojom/video_common.mojom";
-import "components/arc/mojom/app.mojom";
-import "components/arc/mojom/intent_common.mojom";
-import "mojo/public/mojom/base/time.mojom";
-import "url/mojom/url.mojom";
-
-// TODO(b/193097194): Use structured types (e.g., url.mojom.Url for URLs).
-
-// Represents a document in Android DocumentsProvider.
-// See Android docs of DocumentsContract.Document for details.
-struct Document {
- // Opaque ID of the document.
- string document_id;
-
- // Display name of the document.
- string display_name;
-
- // MIME type of the document.
- // A directory is represented by a document having MIME_TYPE_DIR MIME type.
- string mime_type;
-
- // Size of the document in bytes. If the size is unknown, -1 is set.
- int64 size;
-
- // Timestamp when the document was modified last time, in milliseconds
- // since UNIX epoch.
- // TODO(crbug.com/672737): Use mojo_base.mojom.Time once the type is
- // converted to a non-native type so that it can be used from Java.
- uint64 last_modified;
-
- // Path to a real file on the Android VFS corresponding to this document,
- // e.g. "/storage/emulated/0/DCIM/kitten.jpg".
- // This value is available in limited DocumentsProviders only. If the
- // provider does not expose real VFS paths, this field is always set to null.
- [MinVersion=5] string? android_file_system_path;
-
- // Flag indicating that a document is deletable.
- [MinVersion=12] bool supports_delete;
-
- // Flag indicating that a document can be renamed.
- [MinVersion=12] bool supports_rename;
-
- // Flag indicating that a document supports writing.
- [MinVersion=12] bool supports_write;
-
- // Flag indicating that a document is a directory that supports creation of
- // new files within it.
- [MinVersion=12] bool dir_supports_create;
-
- // Flag indicating that a document can be copied to another location within
- // the same document provider.
- [MinVersion=12] bool supports_copy;
-
- // Flag indicating that a document can be moved to another location within
- // the same document provider.
- [MinVersion=12] bool supports_move;
-
- // Flag indicating that a document has a thumbnail available that can be
- // fetched with OpenThumbnail.
- [MinVersion=15] bool supports_thumbnail;
-};
-
-// Represents a root in Android DocumentsProvider.
-// See Android docs of DocumentsContract.Root for details.
-struct Root {
- // Authority for the root.
- string authority;
-
- // Opaque ID of the root.
- string root_id;
-
- // Opaque ID of the document which is a directory that represents the top
- // directory of the root.
- string document_id;
-
- // Title for the root, which will be shown to a user.
- string title;
-
- // Summary for the root, which may be shown to a user.
- string? summary;
-
- // Icon for the root, represented in a ARGB_8888 bitmap.
- ArcBitmap? icon;
-
- // Flag indicating that at least one directory under this root supports
- // creating contents.
- [MinVersion=12] bool supports_create;
-
- // Mime types supported by this root.
- [MinVersion=12] array<string>? mime_types;
-};
-
-// Describes the type of a change made to a document.
-[Extensible]
-enum ChangeType {
- // Indicates that the child document list of the watched directory was
- // changed. Note that a watcher can be installed only on directory for now.
- CHANGED = 0,
-
- // Indicates that the watched document itself was deleted.
- // Even if OnDocumentChanged() is called with this change type, the
- // corresponding watcher is not uninstalled automatically. The host must
- // call RemoveWatcher() to clean up an orphaned watcher.
- DELETED = 1,
-};
-
-// Content URL associated with its MIME type.
-struct ContentUrlWithMimeType {
- url.mojom.Url content_url;
- string mime_type;
-};
-
-// Request for opening URLs by sending an intent to the specified activity.
-struct OpenUrlsRequest {
- // Action type of the intent.
- ActionType action_type;
-
- // Target activity for the intent.
- ActivityName activity_name;
-
- // One or more URLs to open with the intent.
- array<ContentUrlWithMimeType> urls;
-
- // Optional string extras. These are the key-value pairs stored in android
- // intents to carry additional data. See:
- // https://developer.android.com/reference/android/content/Intent#putExtra(java.lang.String,%20java.lang.String)
- [MinVersion=17] map<string, string>? extras;
-};
-
-// Supported action types for SelectFilesRequest.
-// Corresponds to Android intent actions described in
-// http://developer.android.com/reference/android/content/Intent.html
-[Extensible]
-enum SelectFilesActionType {
- GET_CONTENT, // Intent.ACTION_GET_CONTENT
- OPEN_DOCUMENT, // Intent.ACTION_OPEN_DOCUMENT
- OPEN_DOCUMENT_TREE, // Intent.ACTION_OPEN_DOCUMENT_TREE
- CREATE_DOCUMENT, // Intent.ACTION_CREATE_DOCUMENT
-};
-
-// Request for having the user select files using ChromeOS file selector,
-// converted from an Android intent.
-struct SelectFilesRequest {
- // Action type of the original Android intent.
- SelectFilesActionType action_type;
-
- // Acceptable document MIME types. Copied from Intent.EXTRA_MIME_TYPES if
- // there are multiple disjoint MIME types (e.g. ["image/*", "video/*"]), or
- // copied from Intent#getType if there is only one. Empty means ["*/*"].
- array<string> mime_types;
-
- // If true, only requests files that can be opened by Android ContentResolver.
- // Corresponds to Intent.CATEGORY_OPENABLE.
- bool openable_only;
-
- // If true, allows the user to select multiple files.
- // Corresponds to Intent.EXTRA_ALLOW_MULTIPLE.
- bool allow_multiple;
-
- // File name to be initially filled in the selector when creating a new file.
- // Corresponds to Intent.EXTRA_TITLE.
- string default_file_name;
-
- // Directory path to be initially opened when the file selector is launched.
- // Corresponds to DocumentsContract.EXTRA_INITIAL_URI.
- string initial_content_uri;
-
- // DocumentPath representation for initial URI.
- // Filled only when DocumentsContract.EXTRA_INITIAL_URI points to a document
- // served by a DocumentsProvider.
- DocumentPath? initial_document_path;
-
- // Android task ID of the request sender.
- int32 task_id;
-
- // Search query to run when the file selector is launched.
- // Corresponds to Intent.EXTRA_CONTENT_QUERY.
- string? search_query;
-};
-
-// Represents a path to a document served by a DocumentsProvider.
-struct DocumentPath {
- // Authority of the document provider.
- string authority;
-
- // List of document ID from the root document to the child document.
- // This should at least contain root document ID.
- array<string> path;
-};
-
-// Result for SelectFilesRequest.
-struct SelectFilesResult {
- // Content URLs of the selected files.
- // Empty if the user closes the file selector without selecting any files.
- array<url.mojom.Url> urls;
-
- // Name of the selected Android picker activity.
- // Filled only when the user selected an Android picker activity instead of
- // selecting files. (e.g. "com.google.photos/.PickerActivity")
- string? picker_activity;
-};
-
-// UI event to be dispatched to ChromeOS file selector.
-struct FileSelectorEvent {
- // Type of the UI event.
- FileSelectorEventType type;
-
- // Specifies the target directory/file for CLICK_DIRECTORY/CLICK_FILE.
- FileSelectorElement click_target;
-
- // Android task ID of the activity that created the file selector by sending
- // a SelectFilesRequest.
- int32 creator_task_id;
-};
-
-// Types of UI events for FileSelectorEvent.
-[Extensible]
-enum FileSelectorEventType {
- CLICK_OK, // Clicks OK button.
- CLICK_DIRECTORY, // Clicks a directory in the left pane.
- CLICK_FILE, // Clicks a file in the right pane.
- CLICK_CANCEL, // Clicks Cancel button.
-};
-
-// Request for GetFileSelectorElements.
-struct GetFileSelectorElementsRequest {
- // Android task ID of the activity that created the file selector by sending
- // a SelectFilesRequest.
- int32 creator_task_id;
-};
-
-// Represents a clickable UI element shown on ChromeOS file selector.
-struct FileSelectorElement {
- // User-visible label of the element (e.g. button text).
- // This is usually equivalent to accessibility label of the element.
- string name;
-};
-
-// A subset of clickable UI elements shown on ChromeOS file selector.
-struct FileSelectorElements {
- // List of directories in the left pane.
- array<FileSelectorElement> directory_elements;
-
- // List of files in the right pane.
- array<FileSelectorElement> file_elements;
-
- // Query text filled in the search box.
- string? search_query;
-};
-
-// Returned output for GetRootSize.
-struct RootSize {
- // Available size of a root in bytes. Set to -1 if the available size is
- // unknown or unbounded.
- int64 available_bytes;
-
- // Capacity of a root in bytes. Set to -1 if the capacity is unknown or
- // unbounded.
- int64 capacity_bytes;
-};
-
-// Next method ID: 12
-interface FileSystemHost {
- // Returns the name of the file specified by the URL.
- // When an error occurs, returns null value.
- [MinVersion=6] GetFileName@1(string url) => (string? name);
-
- // Returns the size of the file specified by the URL.
- // If the file does not exist or the size is unknown (e.g. directories and
- // streams), -1 is returned.
- [MinVersion=6] GetFileSize@2(string url) => (int64 size);
-
- // Returns the last modified timestamp of the file specified by the URL.
- [MinVersion=20] GetLastModified@11(url.mojom.Url url)
- => (mojo_base.mojom.Time? last_modified);
-
- // Returns the MIME type of the file specified by the URL.
- // When an error occurs, returns null value.
- [MinVersion=6] GetFileType@3(string url) => (string? mime_type);
-
- // Called when a watched document was changed.
- // |type| describes the type of change made to the document.
- [MinVersion=3] OnDocumentChanged@0(int64 watcher_id, ChangeType type);
-
- // Called when the list of available roots or their metadata are changed.
- [MinVersion=10] OnRootsChanged@6();
-
- // Returns a unique ID to represent the file specified by the URL.
- // The FD needs to be created by the caller itself.
- [MinVersion=16] GetVirtualFileId@9(string url) => (string? id);
-
- // Releases the ID generated by GetVirtualFileId() when it is no longer
- // used.
- [MinVersion=16] HandleIdReleased@10(string id) => (bool success);
-
- // Returns an FD for reading the file specified by the URL.
- [MinVersion=6] OpenFileToRead@4(string url) => (handle? fd);
-
- // Asks the user to select files using ChromeOS file selector.
- [MinVersion=9] SelectFiles@5(SelectFilesRequest request) =>
- (SelectFilesResult result);
-
- // Dispatches a UI event to the ChromeOS file selector previously opened by
- // SelectFiles@5. This exists for running Android UI tests (CTS) on ChromeOS
- // file selector, and thus it is only allowed under test conditions.
- [MinVersion=11] OnFileSelectorEvent@7(FileSelectorEvent event) => ();
-
- // Returns UI elements shown on the ChromeOS file selector previously opened
- // by SelectFiles@5. This exists for running Android UI tests (CTS) on
- // ChromeOS file selector, and thus it is only allowed under test conditions.
- [MinVersion=11] GetFileSelectorElements@8(
- GetFileSelectorElementsRequest request) =>
- (FileSelectorElements elements);
-};
-
-// Next method ID: 24
-interface FileSystemInstance {
- // Notes about Android Documents Provider:
- //
- // In Android Storage Access Framework, a document is uniquely identified by
- // a pair of "authority" and "document ID".
- //
- // - An authority specifies a Documents Provider that serves a document.
- // It is the origin part of a content:// URI used to access the Documents
- // Provider via Content Resolver protocol.
- // Example: "com.android.providers.media.documents"
- // - A documents provider may provide one or more roots. Each root is identified
- // by a root ID.
- // - A document ID is an opaque string that specifies a particular document
- // in a documents provider. Its format varies by providers. Roots also have
- // associated document IDs.
- //
- // See the following documents for details about Documents Provider:
- // https://developer.android.com/guide/topics/providers/document-provider.html
- // https://developer.android.com/reference/android/provider/DocumentsContract.html
-
- // Installs a document watcher to watch updates of a document.
- //
- // Currently, watchers can be installed only on directories, and only
- // directory content changes are notified.
- //
- // On success, a positive unique integer is returned as a watcher ID.
- // FileSystemHost.OnDocumentChanged() will be called with the watcher ID
- // on directory content changes.
- // On failure, -1 is returned.
- //
- // It is allowed to install multiple watchers to the same directory. In that
- // case, different watcher IDs are returned.
- //
- // Watchers are not persistent. When the Mojo connection is lost, all
- // watchers are cleared. Also, after reconnecting, watcher IDs can be reused.
- [MinVersion=3] AddWatcher@6(string authority, string document_id) =>
- (int64 watcher_id);
-
- // Queries child documents of the directory specified by |authority| and
- // |parent_document_id| in Documents Provider.
- // If such a directory does not exist, null is returned.
- [MinVersion=2] GetChildDocuments@4(string authority,
- string parent_document_id) =>
- (array<Document>? documents);
-
- // Queries the document specified by |authority| and |document_id| in
- // Documents Provider.
- // If such a document does not exist, null is returned.
- [MinVersion=2] GetDocument@3(string authority, string document_id) =>
- (Document? document);
-
- // Asks the ContentResolver for the size of the file specified by the URL.
- // If the file does not exist or the size is unknown (e.g. directories and
- // streams), -1 is returned.
- [MinVersion=1] GetFileSize@1(string url) => (int64 size);
-
- // Asks the ContentResolver to get the MIME type of the file specified by the
- // URL. When an error occurs, returns null value.
- [MinVersion=4] GetMimeType@8(string url) => (string? mime_type);
-
- // Queries recent documents of a root specified by |authority| and |root_id|.
- // If the root exists and it supports recent document queries, a (possibly
- // empty) list of documents is returned. Otherwise, null is returned.
- [MinVersion=5] GetRecentDocuments@9(string authority, string root_id) =>
- (array<Document>? documents);
-
- // Obtains cached roots from all Documents Providers.
- // If there is no root in ARC, an empty array is returned.
- // If an error is found during GetRoots() method processing in ARC, null
- // value is returned.
- [MinVersion=10] GetRoots@12() => (array<Root>? roots);
-
- // Queries available roots to find the one matching |root_id| and |authority|.
- // Obtains the root's available bytes and capacity bytes for |root_size|.
- // Returns null if there is no root that matches the input parameters.
- [MinVersion=18] GetRootSize@22(string authority, string root_id) =>
- (RootSize? root_size);
-
- // Deletes the given document.
- [MinVersion=12] DeleteDocument@13(string authority, string document_id) =>
- (bool success);
-
- // Changes the display name of an existing document.
- [MinVersion=12] RenameDocument@14(string authority,
- string document_id,
- string display_name) =>
- (Document? document);
-
- // Creates a new document with given MIME type and display name.
- [MinVersion=12] CreateDocument@15(string authority,
- string parent_document_id,
- string mime_type,
- string display_name) =>
- (Document? document);
-
- // Copies the given document.
- [MinVersion=12] CopyDocument@16(string authority,
- string source_document_id,
- string target_parent_document_id) =>
- (Document? document);
-
- // Moves the given document under a new parent.
- [MinVersion=12] MoveDocument@17(string authority,
- string source_document_id,
- string source_parent_document_id,
- string target_parent_document_id) =>
- (Document? document);
-
- // DEPRECATED: Please use Init@10 instead.
- [MinVersion=3] InitDeprecated@5(pending_remote<FileSystemHost> host_remote);
-
- // Establishes full-duplex communication with the host.
- [MinVersion=7] Init@10(pending_remote<FileSystemHost> host_remote) => ();
-
- // Asks the ContentResolver to get a FD to read the file specified by the
- // URL.
- [MinVersion=1] OpenFileToRead@2(string url) => (handle? fd);
-
- // Asks the ContentResolver to get a FD to write the file specified by the
- // URL.
- [MinVersion=13] OpenFileToWrite@18(string url) => (handle? fd);
-
- // Asks the ContentResolver to get a FD to read the thumbnail of a
- // DocumentsProvider file specified by the URL. The thumbnail should be close
- // in size (width and height) but not necessarily the same as |size_hint|.
- [MinVersion=15] OpenThumbnail@21(string url, Size size_hint) => (handle? fd);
-
- // Uninstalls a document watcher.
- //
- // After this method call returns, OnDocumentChanged() will never be called
- // with the watcher ID. Whether OnDocumentChanged() is called or not after
- // this method is called and before this method returns is undefined.
- //
- // It fails if the specified watcher does not exist.
- [MinVersion=3] RemoveWatcher@7(int64 watcher_id) => (bool success);
-
- // Requests MediaProvider to scan specified files.
- // When the specified file does not exist, the corresponding entry in
- // MediaProvider is removed.
- //
- // NOTE: We use [UnlimitedSize] here because `paths` may be arbitrarily large
- // and there have been crash dumps indicating that it actually happens with
- // this message. See https://crbug.com/1142019.
- [UnlimitedSize]
- RequestMediaScan@0(array<string> paths);
-
- // Reloads and refreshes entries in MediaStore under |directory_path|.
- [MinVersion=14] ReindexDirectory@19(string directory_path);
-
- // Searches for the removed files/directories under the given
- // |directory_paths| (non-recursively) in MediaStore and removes them.
- [MinVersion=14] RequestFileRemovalScan@20(array<string> directory_paths);
-
- // DEPRECATED. Use OpenUrlsWithPermissionAndWindowInfo() instead.
- [MinVersion=8] OpenUrlsWithPermission@11(OpenUrlsRequest request) => ();
-
- // Opens URLs by sending an intent to the specified activity with a specific
- // launch window info.
- //
- // Since this grants read/write URL permissions to the activity, callers must
- // ensure that the user is correctly aware of the URLs and the activity they
- // are passing.
- [MinVersion=19] OpenUrlsWithPermissionAndWindowInfo@23(
- OpenUrlsRequest request, WindowInfo window_info) => ();
-};
diff --git a/intent_common.mojom b/intent_common.mojom
deleted file mode 100644
index aedd017..0000000
--- a/intent_common.mojom
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module arc.mojom;
-
-// Describes the type of action to invoke.
-[Extensible]
-enum ActionType {
- VIEW, // Can handle only one URL.
- SEND, // Can handle only one URL.
- SEND_MULTIPLE, // Can handle multiple URLs.
- CREATE_NOTE, // Can handle only one URL.
-};
-
-// Describes an activity.
-struct ActivityName {
- string package_name;
- string? activity_name; // may be null to indicate any activity within package
-};
diff --git a/intent_helper.mojom b/intent_helper.mojom
deleted file mode 100644
index 122eccf..0000000
--- a/intent_helper.mojom
+++ /dev/null
@@ -1,474 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// Next MinVersion: 49
-
-module arc.mojom;
-
-import "ash/components/arc/mojom/bitmap.mojom";
-import "ash/components/arc/mojom/camera_intent.mojom";
-import "components/arc/mojom/app.mojom";
-import "components/arc/mojom/intent_common.mojom";
-import "components/arc/mojom/scale_factor.mojom";
-import "mojo/public/mojom/base/safe_base_name.mojom";
-import "url/mojom/url.mojom";
-
-[Extensible]
-enum PatternType {
- PATTERN_LITERAL,
- PATTERN_PREFIX,
- PATTERN_SIMPLE_GLOB,
-};
-
-[Extensible]
-enum ShareFiles {
- // 0 and 3: capture that everything went great, the files were copied.
- SINGLE_FILE_SUCCESS = 0,
- // 1 and 4: Whenever we fail to copy, we try to delete the partially copied
- // files, if the backroll goes well we call this entry.
- SINGLE_FILE_BACKROLLED = 1,
- // 2 and 5: Whenever we are unable to backroll because something else went
- // wrong, we place this error on the MISC_ERROR bin. (it could have been a bad
- // file descriptor, or just a read/write error)
- SINGLE_FILE_MISC_ERROR = 2,
- MULTIPLE_FILES_SUCCESS = 3,
- MULTIPLE_FILES_BACKROLLED = 4,
- MULTIPLE_FILES_MISC_ERROR = 5,
- // This records a faulty response from DocumentsUI, since our implementation
- // relies on DocumentsUI, sometimes it may return a bad response that we
- // cannot process (e.g. for a single file DocumentsUI is in charge of creating
- // the new file where we will copy, if it fails it can send us a bad response
- // or maybe DocumentsUI is not returning the expected flags).
- BAD_RESPONSE_FROM_DOCUMENTS_UI = 6,
-};
-
-struct PatternMatcher {
- string pattern;
- PatternType type;
-};
-
-struct AuthorityEntry {
- string host;
- int32 port;
-};
-
-struct UriComponents {
- string scheme; // Scheme to create URI in ARC.
- string authority; // Authority to create URI in ARC.
- string path; // Path to create URI in ARC.
-};
-
-struct IntentInfo {
- string action;
- array<string>? categories;
- string? data; // URI
- string? type; // explicit MIME type for data
- [MinVersion=13] string? clip_data_uri; // optional URI to provide as ClipData.
- [MinVersion=20] bool ui_bypassed; // Whether or not the user saw the UI.
-
- // Optional string extras. These are the key-value pairs stored in android
- // intents to carry additional data. See:
- // https://developer.android.com/reference/android/content/Intent#putExtra(java.lang.String,%20java.lang.String)
- [MinVersion=22] map<string, string>? extras;
-
- // Optional URI components to build data URI in ARC. If |IntentInfo.data| is
- // set, this field will be ignored.
- [MinVersion=30] UriComponents? uri_components;
-};
-
-struct IntentFilter {
- array<string> actions;
- array<string> categories;
- array<string> data_schemes;
- [MinVersion=10] array<AuthorityEntry>? data_authorities;
- [MinVersion=10] array<PatternMatcher>? data_paths;
- [MinVersion=10] array<PatternMatcher>? deprecated_data_scheme_specific_parts;
- [MinVersion=21] string? package_name; // Package which registered the filter.
- [MinVersion=38] array<string>? mime_types; // Intent filer mime types.
-
- // Activity which registered the filter.
- [MinVersion=39] string? activity_name;
-
- // The label shown to the user for this activity.
- [MinVersion=41] string? activity_label;
-};
-
-// Describes a package that can handle an intent.
-struct IntentHandlerInfo {
- string name;
- string package_name;
- string activity_name; // A hint for retrieving the package's icon.
- [MinVersion=4] ActionType action_type;
- [MinVersion=6] bool is_preferred;
- [MinVersion=11] string? action; // e.g. "android.intent.action.VIEW"
- // RequestUrlHandlerList may fill |fallback_url| when it is called with an
- // intent: URL.
- [MinVersion=14] string? fallback_url;
-};
-
-// Describes an icon for the activity.
-struct ActivityIcon {
- ActivityName activity;
- uint32 width; // in px
- uint32 height; // in px
- array<uint8> icon; // in BGRA8888 format
- [MinVersion=40] RawIconPngData? icon_png_data;
-};
-
-// URL associated with its mime type.
-struct UrlWithMimeType {
- string url;
- string mime_type;
-};
-
-// Describes a specific page in chrome://, about:blank, about:downloads and about:history.
-// This enum should have only the chrome pages used by ARC.
-// Numerical values should be used for each constant and should not be reused.
-[Extensible]
-enum ChromePage {
- MULTIDEVICE = 0,
- MAIN = 1,
- POWER = 2,
- BLUETOOTH = 3,
- DATETIME = 4,
- DISPLAY = 5,
- WIFI = 6,
- LANGUAGES = 7,
- // TODO(b/181930573): Remove after P retires. This value is used only by P.
- PRIVACY = 8,
- HELP = 9,
- ACCOUNTS = 10,
- APPEARANCE = 11,
- AUTOFILL = 12,
- BLUETOOTHDEVICES = 13,
- CHANGEPICTURE = 14,
- CLEARBROWSERDATA = 15,
- CLOUDPRINTERS = 16,
- CUPSPRINTERS = 17,
- DOWNLOADS = 18,
- KEYBOARDOVERLAY = 19,
- LOCKSCREEN = 20,
- MANAGEACCESSIBILITY = 21,
- NETWORKSTYPEVPN = 22,
- ONSTARTUP = 23,
- PASSWORDS = 24,
- POINTEROVERLAY = 25,
- RESET = 26,
- SEARCH = 27,
- STORAGE = 28,
- SYNCSETUP = 29,
- ABOUTBLANK = 30,
- ABOUTDOWNLOADS = 31,
- ABOUTHISTORY = 32,
- // 33-48 are removed intentionally. Do not reuse them.
- MANAGEACCESSIBILITYTTS = 49,
- // 50-70 are removed intentionally. Do not reuse them.
- OSLANGUAGESINPUT = 71,
- OSLANGUAGESLANGUAGES = 72,
- // 73-76 are removed intentionally. Do not reuse them.
- SMARTPRIVACY = 77,
-
- // Next value to be used is 78.
-};
-
-// Describes an unique chrome app.
-[Extensible]
-enum ChromeApp {
- CAMERA,
-
- LAST = CAMERA,
-};
-
-// Describes an action given by the android text selection delegate (e.g. open
-// maps).
-struct TextSelectionAction {
- // The icon of the component that can handle the action intent.
- ActivityIcon icon;
-
- // The activity and package name of the component that handle the intent.
- ActivityName activity;
-
- // The title of the action that will be shown in the UI, e.g. "Map", "Call",
- // "Open".
- string title;
-
- // The intent to launch when the action is clicked.
- IntentInfo action_intent;
-
- // Whether the action was generated by the Android TextClassifier.
- [MinVersion=23] bool text_classifier_action;
-
- // The bitmap icon of the component that can handle the action intent.
- [MinVersion=23] ArcBitmap? bitmap_icon;
-};
-
-// Location and metadata for a single file attached to an app launch.
-struct LaunchFileInfo {
- // URI location for the file, likely with a content:// scheme.
- url.mojom.Url content_uri;
-
- // MIME type for the file. Will be "application/octet-stream" if no more
- // specific type can be determined.
- string type;
-
- // TODO(crbug.com/1238215): Remove references and rename.
- string deprecated_name;
-
- // Size of the file in bytes.
- uint64 size;
-
- // Human readable name for the file.
- [MinVersion=48] mojo_base.mojom.SafeBaseName? name;
-};
-
-// Contains the information needed to launch an app along with any data which
-// was shared to it.
-struct LaunchIntent {
- string action;
-
- // URI for the data to be handled by this intent.
- url.mojom.Url? data;
-
- // MIME type of the intent data.
- string? type;
-
- // The contents of Intent.EXTRA_SUBJECT.
- string? extra_subject;
-
- // The contents of Intent.EXTRA_TEXT.
- string? extra_text;
-
- // File metadata for files shared through Intent.EXTRA_STREAM.
- array<LaunchFileInfo>? files;
-};
-
-// Contains information about an app's supported links.
-struct SupportedLinks {
- // Android package name of the app.
- string package_name;
- // A list of all the link intent filters handled by the app. Should only
- // include, link intents. That is, filters must have an http/https scheme and
- // at least one authority. This field can be omitted when deleting supported
- // links for an app.
- array<IntentFilter>? filters;
-};
-
-// The source of a change in the supported links setting.
-[Extensible]
-enum SupportedLinkChangeSource {
- kUnknown,
- // The ARC system made a change to the supported links setting without direct
- // user input (e.g. a new app was installed).
- kArcSystem,
- // The update to the supported links setting was the result of a user
- // action/choice.
- kUserPreference,
-};
-
-// Interface to interact with a custom tab.
-// Close the interface pointer to close the custom tab.
-// Next method ID: 1
-interface CustomTabSession {
- // Called when "Open in Chrome" button on the custom tab is clicked.
- [MinVersion=26] OnOpenInChromeClicked@0();
-};
-
-// Handles intents from ARC in Chrome.
-// Deprecated method ID: 4, 9, 10, 16
-// Next method ID: 21
-interface IntentHelperHost {
- // Called when icons associated with the package are no longer up to date.
- [MinVersion=3] OnIconInvalidated@1(string package_name);
-
- // Called when intent filters are updated on startup.
- [MinVersion=9] OnIntentFiltersUpdated@5(array<IntentFilter> intent_filters);
-
- // Opens the downloads directory in the Chrome OS file manager.
- [MinVersion=5] OnOpenDownloads@2();
-
- // Opens the url with Chrome for Chrome OS.
- // This function is intended to only open URLs that other web content in Chrome would be able to
- // navigate to as well. No special URLs that allow access to privileged functions are allowed.
- OnOpenUrl@0(string url);
-
- // Opens the |url| with a custom tab.
- // |task_id| specifies the Android task on which the custom tab should be
- // shown.
- [MinVersion=42] OnOpenCustomTab@17(string url, int32 task_id)
- => (pending_remote<CustomTabSession>? session);
-
- // Opens the wallpaper picker dialog.
- [MinVersion=6] OpenWallpaperPicker@3();
-
- // Opens the volume control.
- [MinVersion=16] OpenVolumeControl@6();
-
- // Opens the specified Chrome page in the Chrome browser.
- [MinVersion=17] OnOpenChromePage@7([MinVersion=18] ChromePage page);
-
- // Opens the specified URL as a web app if it is installed. Otherwise falls
- // back to the behaviour of OnOpenUrl. |url| must have a HTTPS scheme.
- [MinVersion=23] OnOpenWebApp@8(string url);
-
- // Records Sharing files feature's metrics via Chrome.
- [MinVersion=24] RecordShareFilesMetricsDeprecated@9(ShareFiles flag);
-
- // Does a reset of ARC; this wipes /data, and then re-calls on OOBE for
- // account binding to happen again, as if the user just went through OOBE.
- [MinVersion=27] FactoryResetArc@11();
-
- // Launches camera app from the camera intent.
- // |intent_id| is an unique id that used to recognize different intents.
- // |mode| indicates which mode should camera app land on. If
- // |should_handle_result| is true, the intent expects the captured result
- // will be returned after capturing. If |should_down_scale| is true, the
- // intent expects the captured image would be down-scaled to a small enough
- // size. If |is_secure| is true, the intent is fired when the device is
- // secured, which means the camera app should not show any user-sensitive
- // data. |task_id| represents the id of the caller task in ARC.
- [MinVersion=28] LaunchCameraApp@12(uint32 intent_id,
- CameraIntentMode mode,
- bool should_handle_result,
- bool should_down_scale,
- bool is_secure,
- [MinVersion=36] int32 task_id);
-
- // Called when intent filters are updated for one package. This will be
- // called when apps are installed, uninstalled or updated.
- [MinVersion=29] OnIntentFiltersUpdatedForPackage@13(
- string package_name, array<IntentFilter> intent_filters);
-
- // Closes Chrome camera app.
- [MinVersion=31] CloseCameraApp@14();
-
- // Checks if given chrome app is enabled.
- [MinVersion=33] IsChromeAppEnabled@15(ChromeApp app) => (bool is_enabled);
-
- // DEPRECATED. Use OnSupportedLinksChanged() instead.
- // TODO(crbug.com/1265318): Remove this method.
- [MinVersion=34] OnPreferredAppsChangedDeprecated@16(
- array<IntentFilter> added, array<IntentFilter> deleted);
-
- // Called when the link capturing preference for one or more apps has changed.
- // Set the apps in |added_packages| as handling their supported link
- // IntentFilters, and removes the apps in |removed_packages| from handling
- // supported links.
- [MinVersion=47] OnSupportedLinksChanged@20(
- array<SupportedLinks> added_packages,
- array<SupportedLinks> removed_packages,
- [MinVersion=48] SupportedLinkChangeSource source);
-
- // Called when a new entry has been added to the MediaStore.Downloads
- // collection of downloaded items with the specified metadata.
- // |relative_path| relative path of the download within the Download/
- // folder (e.g. "Download/foo/bar.pdf"). The method
- // implementation must verify that the `relative_path` is
- // in fact within the Download/ folder (or subdirectory),
- // treating ARC as an untrusted source.
- // |owner_package_name| package name that contributed the download (e.g.
- // "com.bar.foo").
- [MinVersion=44] OnDownloadAdded@18(
- string relative_path, string owner_package_name);
-
- // Opens the web app for a specified URL, if it is installed, and delivers
- // |intent| to it. If the URL is not installed, will open |intent.data| in a
- // browser tab, unless |intent.data| is not set, in which case nothing
- // happens.
- // Note that the |start_url| is used for resolving the app to open, but the
- // actual URL which is loaded is based on the contents of |intent|.
- [MinVersion=45] OnOpenAppWithIntent@19(
- url.mojom.Url start_url, LaunchIntent intent);
-};
-
-// Sends intents to ARC on behalf of Chrome.
-// Deprecated method ID: 0, 7, 11, 12, 14, 18
-// Next method ID: 22
-interface IntentHelperInstance {
- // Sets the given package as a preferred package. The next time an ACTION_VIEW
- // intent is sent with a URL that requires disambiguation, instead of opening
- // the ResolverActivity, this package will be picked if it is on the list.
- // When multiple packages are set as preferred, the most recent setting wins.
- [MinVersion=7] AddPreferredPackage@8(string package_name);
-
- // Sets the given package as a preferred app for the given |intent_filter|
- // and |intent_info|.
- // The |package_name| is selected by the user on Chrome-side to remember the
- // user preference. The |intent_info| is used to generate the components set
- // and match for setting the preferred activity.
- // This is used to sync the preferred app setting from Chrome OS.
- [MinVersion=32] AddPreferredApp@17(string package_name,
- IntentFilter intent_filter,
- IntentInfo intent_info);
-
- // Set the verified link domain status to either always open (|always_open| is
- // true) or always ask (|always_open| is false) for the |package_names|.
- // This method will be called when Chrome OS changes the link capturing
- // setting for an app.
- [MinVersion=46] SetVerifiedLinks@21(array<string> package_names,
- bool always_open);
-
- // DEPRECATED. Use HandleIntentWithWindowInfo() instead.
- [MinVersion=12] HandleIntent@10(IntentInfo intent, ActivityName activity);
-
- // Passes an intent to an activity with a specific launch window info.
- [MinVersion=43] HandleIntentWithWindowInfo@20(
- IntentInfo intent, ActivityName activity, WindowInfo window_info);
-
- // Handles the URL by sending an ACTION_VIEW intent to the package. The
- // most suitable activity for the URL within the package will be started.
- [MinVersion=2] HandleUrl@2(string url, string package_name);
-
- // Establishes full-duplex communication with the host.
- [MinVersion=19] Init@13(pending_remote<IntentHelperHost> host_remote) => ();
-
- // Requests 48dp * 48dp icons of the |activities| suitable for the
- // |scale_factor|. An array of icon data will be returned.
- [MinVersion=3] RequestActivityIcons@4(array<ActivityName> activities,
- ScaleFactor scale_factor)
- => (array<ActivityIcon> icons);
-
- // Requests a list of packages that can handle |intent|.
- [MinVersion=12] RequestIntentHandlerList@9(IntentInfo intent)
- => (array<IntentHandlerInfo> handlers);
-
- // Requests a list of packages that can handle the URL.
- [MinVersion=2] RequestUrlHandlerList@3(string url)
- => (array<IntentHandlerInfo> handlers);
-
- // Requests a list of packages that can handle the list of files.
- [MinVersion=4] RequestUrlListHandlerList@6(array<UrlWithMimeType> urls)
- => (array<IntentHandlerInfo> handlers);
-
- // Send an Android broadcast message to the Android package and class
- // specified. Data can be sent as extras by including a JSON map string which
- // will be automatically converted to a bundle accessible by the receiver.
- //
- // Note: Broadcasts can only be sent to allowlisted packages. Packages can be
- // added to the allowlist in ArcBridgeService.java in the Android source.
- [MinVersion=1] SendBroadcast@1(string action,
- string package_name,
- string cls,
- string extras);
-
- // Asks ChromeTextSelectionDelegate to generate actions that can handle the
- // |text|. |scale_factor| is used to find a suitable icon to show in the
- // context menu.
- [MinVersion=22] RequestTextSelectionActions@15(string text,
- ScaleFactor scale_factor)
- => (array<TextSelectionAction> actions);
-
- // Sends the captured result |data| for corresponding intent recognized by
- // |intent_id| back to ARC. The handler should handle |data| and maybe notify
- // the intent caller according to the intention of the |action|. |is_success|
- // will be set to true if the ARC received the result and set to false for
- // invalid input.
- [MinVersion=28] HandleCameraResult@16(uint32 intent_id,
- CameraIntentAction action,
- array<uint8> data)
- => (bool is_success);
-
- // Request ARC to send the domain verification status update for all packages
- // to Chrome OS.
- [MinVersion=37] RequestDomainVerificationStatusUpdate@19();
-};
diff --git a/scale_factor.mojom b/scale_factor.mojom
deleted file mode 100644
index 883425b..0000000
--- a/scale_factor.mojom
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module arc.mojom;
-
-// Duplicates ui::ResourceScaleFactor enum in order to be accessible on
-// Android side.
-[Extensible]
-enum ScaleFactor {
- SCALE_FACTOR_NONE = 0,
- SCALE_FACTOR_100P,
- SCALE_FACTOR_125P, // deprecated
- SCALE_FACTOR_133P, // deprecated
- SCALE_FACTOR_140P, // deprecated
- SCALE_FACTOR_150P, // deprecated
- SCALE_FACTOR_180P, // deprecated
- SCALE_FACTOR_200P,
- SCALE_FACTOR_250P, // deprecated
- SCALE_FACTOR_300P,
-
- NUM_SCALE_FACTORS
-};