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

Side by Side 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: add a missing override; 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 unified diff | Download patch
OLDNEW
(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 "ash/ash_export.h"
9 #include "base/macros.h"
10
11 class RenderViewContextMenuObserver;
12 class RenderViewContextMenuProxy;
13
14 namespace ash {
15
16 // A class for populating and updating "Open with <app>" menu items in a
17 // renderer context menu.
18 class ASH_EXPORT OpenWithMenuController {
19 public:
20 class Delegate {
21 public:
22 virtual ~Delegate() {}
23 virtual RenderViewContextMenuObserver* CreateMenu(
24 RenderViewContextMenuProxy* proxy,
25 int menu_id_start,
26 size_t num_menu_items,
27 int sub_menu_id_start,
28 size_t num_sub_menu_items) = 0;
29 };
30
31 OpenWithMenuController();
32 void SetDelegate(Delegate* delegate);
33
34 // Returns a menu observer that populates "Open with <app>" context menu
35 // items. When such type of a menu is not supported, returns nullptr.
36 // The returned menu observer will add up to |num_menu_items| main context
37 // menu items starting from |menu_id_start| to the |proxy|. The object may
38 // also use up to |num_sub_menu_items| IDsstarting from |sub_menu_id_start|
39 // when a sub menu is needed. The caller takes ownership of the returned
40 // object.
41 RenderViewContextMenuObserver* CreateMenu(RenderViewContextMenuProxy* proxy,
42 int menu_id_start,
43 size_t num_menu_items,
44 int sub_menu_id_start,
45 size_t num_sub_menu_items);
46
47 private:
48 Delegate* delegate_;
49
50 DISALLOW_COPY_AND_ASSIGN(OpenWithMenuController);
51 };
52
53 } // namespace ash
54
55 #endif // ASH_RENDERER_CONTEXT_MENU_OPEN_WITH_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698