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

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: add a missing override; Created 4 years, 9 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..5e526eddae917048760991a27cc1d7114db97d5e 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/open_with_menu_observer.h"
#include "url/gurl.h"
namespace arc {
@@ -20,13 +21,29 @@ 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(NULL);
Luis Héctor Chávez 2016/04/04 23:12:43 nit: s/NULL/nullptr/
+}
+
void ArcIntentHelperBridge::OnOpenUrl(const mojo::String& url) {
GURL gurl(url.get());
ash::Shell::GetInstance()->delegate()->OpenUrl(gurl);
}
+RenderViewContextMenuObserver* ArcIntentHelperBridge::CreateMenu(
+ RenderViewContextMenuProxy* proxy,
+ int menu_id_start,
+ size_t num_menu_items,
+ int sub_menu_id_start,
+ size_t num_sub_menu_items) {
+ return new OpenWithMenuObserver(arc_bridge_service(), proxy, menu_id_start,
+ num_menu_items, sub_menu_id_start,
+ num_sub_menu_items);
+}
+
} // namespace arc
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.h ('k') | components/arc/intent_helper/open_with_menu_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698