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

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

Issue 243403006: Implement contextmenu attribute with basic support of <menu> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added runtime enabled checks Created 6 years, 5 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
11 namespace WebCore {
12
13 class ContextMenu;
14 class HTMLMenuElement;
15
16 class CustomContextMenuProvider FINAL : public ContextMenuProvider {
17 public:
18 static PassRefPtr<CustomContextMenuProvider> create(HTMLMenuElement* menu, c onst Vector<ContextMenuItem>& items)
19 {
20 return adoptRef(new CustomContextMenuProvider(menu, items));
21 }
22
23 private:
24 explicit CustomContextMenuProvider(HTMLMenuElement* menu, const Vector<Conte xtMenuItem>& items)
Inactive 2014/07/16 20:07:26 nit: explicit is not really useful here as this ta
pals 2014/07/17 15:35:47 Done.
25 : m_menu(menu)
26 , m_items(items)
27 {
28 }
29
30 virtual ~CustomContextMenuProvider()
Inactive 2014/07/16 20:07:25 nit: could be in the cpp
pals 2014/07/17 15:35:47 Done.
31 {
32 }
33
34 virtual void populateContextMenu(ContextMenu*) OVERRIDE;
35
36 virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE;
37
38 virtual void contextMenuCleared() OVERRIDE { }
39
40 RefPtr<HTMLMenuElement> m_menu;
41 Vector<ContextMenuItem> m_items;
42 };
43
44 } // namespace
45
46 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698