Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: chrome/browser/chromeos/file_manager/arc_file_tasks.cc

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: rebase, no code change Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_manager/arc_file_tasks.cc
diff --git a/chrome/browser/chromeos/file_manager/arc_file_tasks.cc b/chrome/browser/chromeos/file_manager/arc_file_tasks.cc
index 1c10c0e87f375ea293f894dbb1d63fef7a8ee858..6de7d978f7c24a305c091ee3146e41f1ca753345 100644
--- a/chrome/browser/chromeos/file_manager/arc_file_tasks.cc
+++ b/chrome/browser/chromeos/file_manager/arc_file_tasks.cc
@@ -7,6 +7,7 @@
#include <map>
#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/base64.h"
@@ -51,14 +52,17 @@ constexpr char kPngDataUrlPrefix[] = "data:image/png;base64,";
// Returns the Mojo interface for ARC Intent Helper, with version |minVersion|
// or above. If the ARC bridge is not established, returns null.
-arc::mojom::IntentHelperInstance* GetArcIntentHelper(Profile* profile,
- uint32_t min_version) {
+arc::mojom::IntentHelperInstance* GetArcIntentHelper(
+ Profile* profile,
+ const std::string& method_name_for_logging,
+ uint32_t min_version) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// File manager in secondary profile cannot access ARC.
if (!chromeos::ProfileHelper::IsPrimaryProfile(profile))
return nullptr;
- return arc::ArcIntentHelperBridge::GetIntentHelperInstance(min_version);
+ return arc::ArcIntentHelperBridge::GetIntentHelperInstance(
+ method_name_for_logging, min_version);
}
// Returns the icon loader that wraps the Mojo interface for ARC Intent Helper.
@@ -274,7 +278,8 @@ void FindArcTasks(Profile* profile,
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
arc::mojom::IntentHelperInstance* arc_intent_helper =
- GetArcIntentHelper(profile, kArcIntentHelperVersionWithUrlListSupport);
+ GetArcIntentHelper(profile, "RequestUrlListHandlerList",
+ kArcIntentHelperVersionWithUrlListSupport);
if (!arc_intent_helper) {
callback.Run(std::move(result_list));
return;
@@ -312,7 +317,8 @@ bool ExecuteArcTask(Profile* profile,
DCHECK_EQ(file_urls.size(), mime_types.size());
arc::mojom::IntentHelperInstance* const arc_intent_helper =
- GetArcIntentHelper(profile, kArcIntentHelperVersionWithUrlListSupport);
+ GetArcIntentHelper(profile, "HandleUrlListDeprecated",
+ kArcIntentHelperVersionWithUrlListSupport);
if (!arc_intent_helper)
return false;
@@ -331,7 +337,7 @@ bool ExecuteArcTask(Profile* profile,
urls.push_back(std::move(url_with_type));
}
- if (GetArcIntentHelper(profile,
+ if (GetArcIntentHelper(profile, "HandleUrlList",
kArcIntentHelperVersionWithFullActivityName)) {
arc_intent_helper->HandleUrlList(std::move(urls),
AppIdToActivityName(task.app_id),
« no previous file with comments | « chrome/browser/chromeos/arc/gpu_arc_video_service_host.cc ('k') | chrome/browser/memory/tab_manager_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698