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

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

Issue 2357053002: Always use arc::InstanceHolder<T>::GetInstanceForMethod (Closed)
Patch Set: rebased to catch up tot 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 4b3b6be1a18b68c39541a974d5f301454c3b799e..5a8412313b725f3db9524ba019d11b0a73b35508 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);
Luis Héctor Chávez 2016/09/23 22:51:04 This is MinVersion=4.
Yusuke Sato 2016/09/24 00:15:22 There are two similarly-named functions (oops..),
+ 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(

Powered by Google App Engine
This is Rietveld 408576698