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

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

Issue 1760773004: Add "Open with <ARC-app-name>" items to the context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dcheng's comment Created 4 years, 8 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.cc
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc
index 5c962df9734bfe8824862a562475f1c7fde77aea..6b4078e3d77c5aefd6ac1d233a29957a262cc728 100644
--- a/components/arc/intent_helper/arc_intent_helper_bridge.cc
+++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -6,6 +6,7 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
+#include "components/arc/intent_helper/link_handler_model_impl.h"
#include "url/gurl.h"
namespace arc {
@@ -20,13 +21,26 @@ ArcIntentHelperBridge::~ArcIntentHelperBridge() {
}
void ArcIntentHelperBridge::OnIntentHelperInstanceReady() {
+ ash::Shell::GetInstance()->set_link_handler_model_factory(this);
arc_bridge_service()->intent_helper_instance()->Init(
binding_.CreateInterfacePtrAndBind());
}
+void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() {
+ ash::Shell::GetInstance()->set_link_handler_model_factory(nullptr);
+}
+
void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) {
GURL gurl(url.get());
ash::Shell::GetInstance()->delegate()->OpenUrl(gurl);
}
+std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel(
+ const GURL& url) {
+ std::unique_ptr<LinkHandlerModelImpl> impl(new LinkHandlerModelImpl);
+ if (!impl->Init(url))
+ return nullptr;
+ return std::move(impl);
+}
+
} // namespace arc
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.h ('k') | components/arc/intent_helper/link_handler_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698