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

Unified Diff: components/arc/arc_bridge_service.cc

Issue 1590723003: Host-side implementation of ARC Intent handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support new GURL interface at https://chromium.googlesource.com/chromium/src/+/dfbcc3b7926990bbf523… Created 4 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/arc_bridge_service.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_bridge_service.cc
diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_bridge_service.cc
index cbb8bde97c2481248725325287e778c39ccdde9d..d3448c515faef55fe3c529c321f4c617c05a62b2 100644
--- a/components/arc/arc_bridge_service.cc
+++ b/components/arc/arc_bridge_service.cc
@@ -177,6 +177,32 @@ void ArcBridgeService::CloseInputChannel() {
FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceClosed());
}
+void ArcBridgeService::OnIntentHelperInstanceReady(
+ IntentHelperInstancePtr intent_helper_ptr) {
+ DCHECK(CalledOnValidThread());
+ temporary_intent_helper_ptr_ = std::move(intent_helper_ptr);
+ temporary_intent_helper_ptr_.QueryVersion(
+ base::Bind(&ArcBridgeService::OnIntentHelperVersionReady,
+ weak_factory_.GetWeakPtr()));
+}
+
+void ArcBridgeService::OnIntentHelperVersionReady(int32_t version) {
+ DCHECK(CalledOnValidThread());
+ intent_helper_ptr_ = std::move(temporary_intent_helper_ptr_);
+ intent_helper_ptr_.set_connection_error_handler(base::Bind(
+ &ArcBridgeService::CloseIntentHelperChannel, weak_factory_.GetWeakPtr()));
+ FOR_EACH_OBSERVER(Observer, observer_list(), OnIntentHelperInstanceReady());
+}
+
+void ArcBridgeService::CloseIntentHelperChannel() {
+ DCHECK(CalledOnValidThread());
+ if (!intent_helper_ptr_)
+ return;
+
+ intent_helper_ptr_.reset();
+ FOR_EACH_OBSERVER(Observer, observer_list(), OnIntentHelperInstanceClosed());
+}
+
void ArcBridgeService::OnNotificationsInstanceReady(
NotificationsInstancePtr notifications_ptr) {
DCHECK(CalledOnValidThread());
@@ -328,6 +354,7 @@ void ArcBridgeService::CloseAllChannels() {
CloseClipboardChannel();
CloseImeChannel();
CloseInputChannel();
+ CloseIntentHelperChannel();
CloseNotificationsChannel();
ClosePowerChannel();
CloseProcessChannel();
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698