Index: ash/renderer_context_menu/open_with_menu_controller.cc |
diff --git a/ash/renderer_context_menu/open_with_menu_controller.cc b/ash/renderer_context_menu/open_with_menu_controller.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..389b4f098670ac89f815e6de8d928e2d2bc57d60 |
--- /dev/null |
+++ b/ash/renderer_context_menu/open_with_menu_controller.cc |
@@ -0,0 +1,36 @@ |
+// 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 "ash/renderer_context_menu/open_with_menu_controller.h" |
+ |
+namespace ash { |
+ |
+OpenWithMenuController::OpenWithMenuController() : delegate_(nullptr) {} |
+ |
+void OpenWithMenuController::SetDelegate(Delegate* delegate) { |
+ delegate_ = delegate; |
+} |
+ |
+int OpenWithMenuController::PopulateOpenWithMenu( |
+ RenderViewContextMenuProxy* proxy, |
+ int menu_id_start, |
+ size_t num_menu_items, |
+ const GURL& url) { |
+ if (delegate_) |
+ return delegate_->PopulateOpenWithMenu(proxy, menu_id_start, num_menu_items, |
+ url); |
+ return 0; |
+} |
+ |
+void OpenWithMenuController::ExecuteCommand(int id) { |
+ if (delegate_) |
+ delegate_->ExecuteCommand(id); |
+} |
+ |
+void OpenWithMenuController::MenuClosed() { |
+ if (delegate_) |
+ delegate_->MenuClosed(); |
+} |
+ |
+} // namespace ash |