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

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

Issue 2337193005: Consolidate 4 GetIntentHelper functions (Closed)
Patch Set: Address comments2 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..ebbcfb3b2c6ca32463d0cb87fe717cd9f234db80 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,16 @@ 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* GetIntentHelperInstanceWithErrorCode(
+ int min_instance_version,
+ GetResult* out_error_code);
+
+ // Does the same as above without asking for the error code.
+ static mojom::IntentHelperInstance* GetIntentHelperInstance(
+ int min_instance_version);
+
private:
mojo::Binding<mojom::IntentHelperHost> binding_;
scoped_refptr<ActivityIconLoader> icon_loader_;
« no previous file with comments | « components/arc/intent_helper/activity_icon_loader.cc ('k') | components/arc/intent_helper/arc_intent_helper_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698