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

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 comments 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..c94b3713cf47d65992e0ea876fc30452d43fa31c 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,27 @@ ArcIntentHelperBridge::~ArcIntentHelperBridge() {
}
void ArcIntentHelperBridge::OnIntentHelperInstanceReady() {
+ ash::Shell::GetInstance()->open_with_menu_controller()->SetDelegate(this);
arc_bridge_service()->intent_helper_instance()->Init(
binding_.CreateInterfacePtrAndBind());
}
+void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() {
+ ash::Shell::GetInstance()->open_with_menu_controller()->SetDelegate(nullptr);
hidehiko 2016/04/20 18:10:18 Could you verify this is always called before this
Yusuke Sato 2016/04/22 05:27:48 Done. Copied line 30 to the destructor following a
+}
+
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(arc_bridge_service()));
+ if (!impl->Init(url))
+ return nullptr;
+ return std::move(impl);
+}
+
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698