OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_ | |
6 #define ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "base/macros.h" | |
12 | |
13 class GURL; | |
14 | |
15 namespace ash { | |
16 | |
17 class LinkHandlerModel; | |
18 | |
19 // A class for populating and updating "Open with <app>" menu items in a | |
20 // 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.
| |
21 class ASH_EXPORT OpenWithMenuController { | |
22 public: | |
23 class Delegate { | |
24 public: | |
25 virtual ~Delegate() {} | |
26 virtual std::unique_ptr<LinkHandlerModel> CreateModel(const GURL& url) = 0; | |
27 }; | |
28 | |
29 OpenWithMenuController(); | |
30 void SetDelegate(Delegate* delegate); | |
31 | |
32 // Returns a menu model of the "Open with <app>" context menu. When a menu for | |
33 // the |url| cannot be created, returns nullptr. | |
34 std::unique_ptr<LinkHandlerModel> CreateModel(const GURL& url); | |
35 | |
36 private: | |
37 Delegate* delegate_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(OpenWithMenuController); | |
40 }; | |
41 | |
42 } // namespace ash | |
43 | |
44 #endif // ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_ | |
OLD | NEW |