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

Side by Side Diff: Source/core/page/CustomContextMenuProvider.h

Issue 492753002: Add support to populate custom context menu items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed comments Created 6 years, 4 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 2014 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 CustomContextMenuProvider_h
6 #define CustomContextMenuProvider_h
7
8 #include "core/page/ContextMenuProvider.h"
9 #include "platform/ContextMenuItem.h"
10 #include "platform/heap/Handle.h"
11
12 namespace blink {
13
14 class ContextMenu;
15 class HTMLElement;
16 class HTMLMenuElement;
17 class HTMLMenuItemElement;
18
19 class CustomContextMenuProvider FINAL : public ContextMenuProvider {
20 public:
21 static PassRefPtr<CustomContextMenuProvider> create(HTMLMenuElement& menu, H TMLElement& subject)
22 {
23 return adoptRef(new CustomContextMenuProvider(menu, subject));
24 }
25
26 private:
27 CustomContextMenuProvider(HTMLMenuElement&, HTMLElement&);
28 virtual ~CustomContextMenuProvider();
29
30 virtual void populateContextMenu(ContextMenu*) OVERRIDE;
31 virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE;
32 virtual void contextMenuCleared() OVERRIDE;
33 void populateContextMenuItems(const HTMLMenuElement&, ContextMenu&);
34 void appendSeparator(ContextMenu&);
35 void appendMenuItem(HTMLMenuItemElement*, ContextMenu&);
36 HTMLElement* menuItemAt(unsigned menuId);
37
38 RefPtrWillBePersistent<HTMLMenuElement> m_menu;
39 RefPtrWillBePersistent<HTMLElement> m_subjectElement;
40 WillBePersistentHeapVector<RefPtrWillBeMember<HTMLElement> > m_menuItems;
41 };
42
43 } // namespace blink
44
45 #endif
OLDNEW
« no previous file with comments | « Source/core/page/ContextMenuController.cpp ('k') | Source/core/page/CustomContextMenuProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698