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

Unified Diff: components/arc/intent_helper/arc_intent_helper_bridge.h

Issue 2337193005: Consolidate 4 GetIntentHelper functions (Closed)
Patch Set: review 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/arc_intent_helper_bridge.h
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.h b/components/arc/intent_helper/arc_intent_helper_bridge.h
index c6bc2e792591f980f6400ed8db6540944a77e1d3..d8ad5213fc307463fd27e7f005b4bba5a202f8fd 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.h
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.h
@@ -37,6 +37,15 @@ class ArcIntentHelperBridge
public mojom::IntentHelperHost,
public ash::LinkHandlerModelFactory {
public:
+ enum class GetResult {
+ // Failed. The intent_helper instance is not yet ready. This is a temporary
+ // error.
+ FAILED_ARC_NOT_READY,
+ // Failed. Either ARC is not supported at all or intent_helper instance
+ // version is too old.
+ FAILED_ARC_NOT_SUPPORTED,
+ };
+
ArcIntentHelperBridge(
ArcBridgeService* bridge_service,
const scoped_refptr<ActivityIconLoader>& icon_loader,
@@ -67,6 +76,12 @@ class ArcIntentHelperBridge
static mojo::Array<mojom::UrlHandlerInfoPtr> FilterOutIntentHelper(
mojo::Array<mojom::UrlHandlerInfoPtr> handlers);
+ // Gets the mojo instance if it's available. On failure, returns nullptr and
+ // updates |out_error_code| if it's not nullptr.
+ static mojom::IntentHelperInstance* GetIntentHelperInstance(
Luis Héctor Chávez 2016/09/14 20:28:49 I wonder if it's better to provide two versions of
Yusuke Sato 2016/09/14 21:02:25 I didn't do this as function overloading is discou
Luis Héctor Chávez 2016/09/14 21:09:12 You can add a "WithErrorCode" suffix if you want t
Yusuke Sato 2016/09/14 21:21:49 Done.
+ int min_instance_version,
+ GetResult* out_error_code);
+
private:
mojo::Binding<mojom::IntentHelperHost> binding_;
scoped_refptr<ActivityIconLoader> icon_loader_;

Powered by Google App Engine
This is Rietveld 408576698