Commit 4bf506a2 authored by hscham's avatar hscham Committed by Commit Bot

Sync component/arc/mojom/ directory with arc

* Add copyright header to app.typemap
* Remove HandleUrlListDeprecated in intent_helper.mojom; it was deleted
  on pi-arc and rvc-arc already
  (ag/q/I5a0c28adfc77fe68710b1efd3d8db02a156a25a4)

BUG=b:147599855, b:149070836, 163091058
TEST=autoninja -C out/Default chrome

Change-Id: I1b88c146327f165111462cd74c455ada12611892
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352306
Commit-Queue: Naoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarSatoshi Niwa <niwa@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Auto-Submit: Grace Cham <hscham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800061}
parent b95fe817
......@@ -92,22 +92,6 @@ arc::mojom::ActivityNamePtr AppIdToActivityName(const std::string& id) {
return name;
}
// Constructs a vector of UrlWithMimeType to be passed to
// IntentHelperInstance.HandleUrlListDeprecated.
std::vector<arc::mojom::UrlWithMimeTypePtr> ConstructUrlWithMimeTypeList(
const std::vector<GURL>& content_urls,
const std::vector<std::string>& mime_types) {
std::vector<arc::mojom::UrlWithMimeTypePtr> urls;
for (size_t i = 0; i < content_urls.size(); ++i) {
arc::mojom::UrlWithMimeTypePtr url_with_type =
arc::mojom::UrlWithMimeType::New();
url_with_type->url = content_urls[i].spec();
url_with_type->mime_type = mime_types[i];
urls.push_back(std::move(url_with_type));
}
return urls;
}
// Constructs an OpenUrlsRequest to be passed to
// FileSystemInstance.OpenUrlsWithPermission.
arc::mojom::OpenUrlsRequestPtr ConstructOpenUrlsRequest(
......@@ -292,51 +276,26 @@ void ExecuteArcTaskAfterContentUrlsResolved(
return;
}
// Try FileSystemInstance.OpenUrlsWithPermission first.
arc::mojom::FileSystemInstance* arc_file_system = ARC_GET_INSTANCE_FOR_METHOD(
arc_service_manager->arc_bridge_service()->file_system(),
OpenUrlsWithPermission);
if (arc_file_system) {
arc::mojom::OpenUrlsRequestPtr request =
ConstructOpenUrlsRequest(task, content_urls, mime_types);
arc_file_system->OpenUrlsWithPermission(std::move(request),
base::DoNothing());
if (!arc_file_system) {
std::move(done).Run(
extensions::api::file_manager_private::TASK_RESULT_MESSAGE_SENT, "");
UMA_HISTOGRAM_ENUMERATION(
"Arc.UserInteraction",
arc::UserInteractionType::APP_STARTED_FROM_FILE_MANAGER);
extensions::api::file_manager_private::TASK_RESULT_FAILED,
"OpenUrlsWithPermission is not supported");
return;
}
// Use IntentHelperInstance.HandleUrlListDeprecated as a fallback if
// OpenUrlsWithPermission is not supported yet.
// TODO(niwa): Remove this once we complete migration.
arc::mojom::IntentHelperInstance* arc_intent_helper =
ARC_GET_INSTANCE_FOR_METHOD(
arc_service_manager->arc_bridge_service()->intent_helper(),
HandleUrlListDeprecated);
if (arc_intent_helper) {
LOG(WARNING) << "Using HandleUrlListDeprecated because "
<< "OpenUrlsWithPermission is not supported yet.";
arc_intent_helper->HandleUrlListDeprecated(
ConstructUrlWithMimeTypeList(content_urls, mime_types),
AppIdToActivityName(task.app_id),
FileTaskActionIdToArcActionType(task.action_id));
std::move(done).Run(
extensions::api::file_manager_private::TASK_RESULT_MESSAGE_SENT, "");
UMA_HISTOGRAM_ENUMERATION(
"Arc.UserInteraction",
arc::UserInteractionType::APP_STARTED_FROM_FILE_MANAGER);
return;
}
arc::mojom::OpenUrlsRequestPtr request =
ConstructOpenUrlsRequest(task, content_urls, mime_types);
arc_file_system->OpenUrlsWithPermission(std::move(request),
base::DoNothing());
std::move(done).Run(
extensions::api::file_manager_private::TASK_RESULT_MESSAGE_SENT, "");
std::move(done).Run(extensions::api::file_manager_private::TASK_RESULT_FAILED,
"No android app to run task");
UMA_HISTOGRAM_ENUMERATION(
"Arc.UserInteraction",
arc::UserInteractionType::APP_STARTED_FROM_FILE_MANAGER);
}
} // namespace
......
# 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.
mojom = "//components/arc/mojom/app.mojom"
public_headers = [ "//components/arc/app/arc_playstore_search_request_state.h" ]
traits_headers = [ "//components/arc/mojom/app_mojom_traits.h" ]
......
......@@ -327,6 +327,7 @@ interface IntentHelperHost {
};
// Sends intents to ARC on behalf of Chrome.
// Deprecated method ID: 7
// Next method ID: 20
interface IntentHelperInstance {
// Sets the given package as a preferred package. The next time an ACTION_VIEW
......@@ -361,11 +362,6 @@ interface IntentHelperInstance {
// most suitable activity for the URL within the package will be started.
[MinVersion=2] HandleUrl@2(string url, string package_name);
// DEPRECATED. Use FileSystemInstance.OpenUrlsWithPermission() instead.
[MinVersion=5] HandleUrlListDeprecated@7(array<UrlWithMimeType> urls,
ActivityName activity,
ActionType action_type);
// DEPRECATED: Please use Init@13 instead.
InitDeprecated@0(pending_remote<IntentHelperHost> host_remote);
......
......@@ -73,11 +73,6 @@ void FakeIntentHelperInstance::HandleIntent(mojom::IntentInfoPtr intent,
void FakeIntentHelperInstance::HandleUrl(const std::string& url,
const std::string& package_name) {}
void FakeIntentHelperInstance::HandleUrlListDeprecated(
std::vector<mojom::UrlWithMimeTypePtr> urls,
mojom::ActivityNamePtr activity,
mojom::ActionType action) {}
void FakeIntentHelperInstance::InitDeprecated(
mojo::PendingRemote<mojom::IntentHelperHost> host_remote) {
Init(std::move(host_remote), base::DoNothing());
......
......@@ -85,10 +85,6 @@ class FakeIntentHelperInstance : public mojom::IntentHelperInstance {
void HandleUrl(const std::string& url,
const std::string& package_name) override;
void HandleUrlListDeprecated(std::vector<mojom::UrlWithMimeTypePtr> urls,
mojom::ActivityNamePtr activity,
mojom::ActionType action) override;
void InitDeprecated(
mojo::PendingRemote<mojom::IntentHelperHost> host_remote) override;
......
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