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

Unified Diff: ash/renderer_context_menu/open_with_menu_controller.h

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: ash/renderer_context_menu/open_with_menu_controller.h
diff --git a/ash/renderer_context_menu/open_with_menu_controller.h b/ash/renderer_context_menu/open_with_menu_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8c922acb78679e278706857d537da0c5d35e552
--- /dev/null
+++ b/ash/renderer_context_menu/open_with_menu_controller.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_
+#define ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_
+
+#include <memory>
+
+#include "ash/ash_export.h"
+#include "base/macros.h"
+
+class GURL;
+
+namespace ash {
+
+class LinkHandlerModel;
+
+// A class for populating and updating "Open with <app>" menu items in a
+// renderer context menu.
Ben Goodger (Google) 2016/04/20 17:56:50 your class names and comments should not refer to:
Yusuke Sato 2016/04/22 05:27:47 Done.
+class ASH_EXPORT OpenWithMenuController {
+ public:
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+ virtual std::unique_ptr<LinkHandlerModel> CreateModel(const GURL& url) = 0;
+ };
+
+ OpenWithMenuController();
+ void SetDelegate(Delegate* delegate);
+
+ // Returns a menu model of the "Open with <app>" context menu. When a menu for
+ // the |url| cannot be created, returns nullptr.
+ std::unique_ptr<LinkHandlerModel> CreateModel(const GURL& url);
+
+ private:
+ Delegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(OpenWithMenuController);
+};
+
+} // namespace ash
+
+#endif // ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698