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

Unified Diff: chrome/browser/renderer_context_menu/open_with_menu_factory_ash.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: chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
diff --git a/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc b/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
new file mode 100644
index 0000000000000000000000000000000000000000..56dbd65c5bba16f1bb69b01f876c07e169b31818
--- /dev/null
+++ b/chrome/browser/renderer_context_menu/open_with_menu_factory_ash.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/renderer_context_menu/open_with_menu_factory.h"
+
+#include "ash/renderer_context_menu/open_with_menu_controller.h"
+#include "ash/shell.h"
+
+namespace {
+
+ash::OpenWithMenuController* GetController() {
+ if (!ash::Shell::HasInstance())
+ return nullptr;
+ return ash::Shell::GetInstance()->open_with_menu_controller();
+}
+
+} // namespace
+
+RenderViewContextMenuObserver* OpenWithMenuFactory::CreateMenu(
+ RenderViewContextMenuProxy* proxy,
+ int menu_id_start,
+ size_t num_menu_items,
+ int sub_menu_id_start,
+ size_t num_sub_menu_items) {
+ ash::OpenWithMenuController* controller = GetController();
+ if (!controller)
+ return nullptr;
+ return controller->CreateMenu(proxy, menu_id_start, num_menu_items,
+ sub_menu_id_start, num_sub_menu_items);
+}

Powered by Google App Engine
This is Rietveld 408576698