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

Unified Diff: components/arc/intent_helper/link_handler_model_impl.cc

Issue 2614173002: Use ARC_GET_INSTANCE_FOR_METHOD for getting intent_helper instance (Closed)
Patch Set: address comment Created 3 years, 11 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
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/intent_helper/link_handler_model_impl.cc
diff --git a/components/arc/intent_helper/link_handler_model_impl.cc b/components/arc/intent_helper/link_handler_model_impl.cc
index 5bf0193bb5775deea036c24ba7dbf87b31425c77..19485e179ffcf22ad22dc6a749b21fe923c4227b 100644
--- a/components/arc/intent_helper/link_handler_model_impl.cc
+++ b/components/arc/intent_helper/link_handler_model_impl.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "components/arc/arc_bridge_service.h"
+#include "components/arc/arc_service_manager.h"
#include "components/arc/intent_helper/arc_intent_helper_bridge.h"
#include "components/google/core/browser/google_util.h"
#include "url/gurl.h"
@@ -18,7 +19,6 @@ namespace arc {
namespace {
-constexpr int kMinInstanceVersion = 2; // see intent_helper.mojom
constexpr int kMaxValueLen = 2048;
bool GetQueryValue(const GURL& url,
@@ -55,8 +55,12 @@ LinkHandlerModelImpl::LinkHandlerModelImpl(
LinkHandlerModelImpl::~LinkHandlerModelImpl() {}
bool LinkHandlerModelImpl::Init(const GURL& url) {
- auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance(
- "RequestUrlHandlerList", kMinInstanceVersion);
+ auto* arc_service_manager = ArcServiceManager::Get();
+ if (!arc_service_manager)
+ return false;
+ auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
+ arc_service_manager->arc_bridge_service()->intent_helper(),
+ RequestUrlHandlerList);
if (!instance)
return false;
@@ -77,8 +81,11 @@ void LinkHandlerModelImpl::AddObserver(Observer* observer) {
void LinkHandlerModelImpl::OpenLinkWithHandler(const GURL& url,
uint32_t handler_id) {
- auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance(
- "HandleUrl", kMinInstanceVersion);
+ auto* arc_service_manager = ArcServiceManager::Get();
+ if (!arc_service_manager)
+ return;
+ auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
+ arc_service_manager->arc_bridge_service()->intent_helper(), HandleUrl);
if (!instance)
return;
if (handler_id >= handlers_.size())
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698