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

Unified Diff: components/arc/intent_helper/link_handler_model_impl.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: 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 061edd4f4b57351bfeb6b5fa813c7894cc0c4dd6..4c6f7382f6a040223c8564f5769edbe1dbd2cbf2 100644
--- a/components/arc/intent_helper/link_handler_model_impl.cc
+++ b/components/arc/intent_helper/link_handler_model_impl.cc
@@ -56,9 +56,9 @@ LinkHandlerModelImpl::LinkHandlerModelImpl(
LinkHandlerModelImpl::~LinkHandlerModelImpl() {}
bool LinkHandlerModelImpl::Init(const GURL& url) {
- mojom::IntentHelperInstance* intent_helper_instance =
- ArcIntentHelperBridge::GetIntentHelperInstance(kMinInstanceVersion);
- if (!intent_helper_instance)
+ auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance(
+ "RequestUrlHandlerList", kMinInstanceVersion);
+ if (!instance)
return false;
// Check if ARC apps can handle the |url|. Since the information is held in
@@ -66,7 +66,7 @@ bool LinkHandlerModelImpl::Init(const GURL& url) {
// callback function, OnUrlHandlerList, is called within a few milliseconds
// even on the slowest Chromebook we support.
const GURL rewritten(RewriteUrlFromQueryIfAvailable(url));
- intent_helper_instance->RequestUrlHandlerList(
+ instance->RequestUrlHandlerList(
rewritten.spec(), base::Bind(&LinkHandlerModelImpl::OnUrlHandlerList,
weak_ptr_factory_.GetWeakPtr()));
return true;
@@ -78,15 +78,14 @@ void LinkHandlerModelImpl::AddObserver(Observer* observer) {
void LinkHandlerModelImpl::OpenLinkWithHandler(const GURL& url,
uint32_t handler_id) {
- mojom::IntentHelperInstance* intent_helper_instance =
- ArcIntentHelperBridge::GetIntentHelperInstance(kMinInstanceVersion);
- if (!intent_helper_instance)
+ auto* instance = ArcIntentHelperBridge::GetIntentHelperInstance(
+ "HandleUrl", kMinInstanceVersion);
+ if (!instance)
return;
if (handler_id >= handlers_.size())
return;
const GURL rewritten(RewriteUrlFromQueryIfAvailable(url));
- intent_helper_instance->HandleUrl(rewritten.spec(),
- handlers_[handler_id]->package_name);
+ instance->HandleUrl(rewritten.spec(), handlers_[handler_id]->package_name);
}
void LinkHandlerModelImpl::OnUrlHandlerList(
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | components/arc/metrics/arc_metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698