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

Unified Diff: Source/core/page/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: Reflect HTMLMenuElement as per spec 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/ContextMenuControllerTest.cpp ('k') | Source/core/page/CustomContextMenuProvider.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/CustomContextMenuProvider.h
diff --git a/Source/core/page/CustomContextMenuProvider.h b/Source/core/page/CustomContextMenuProvider.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb1022164cbf19966846ea2f651c3822ce3e1d41
--- /dev/null
+++ b/Source/core/page/CustomContextMenuProvider.h
@@ -0,0 +1,42 @@
+// Copyright 2014 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 CustomContextMenuProvider_h
+#define CustomContextMenuProvider_h
+
+#include "core/page/ContextMenuProvider.h"
+#include "platform/ContextMenuItem.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class ContextMenu;
+class HTMLElement;
+class HTMLMenuElement;
+
+class CustomContextMenuProvider FINAL : public ContextMenuProvider {
+public:
+ static PassRefPtr<CustomContextMenuProvider> create(HTMLMenuElement& menu, HTMLElement& subject)
+ {
+ return adoptRef(new CustomContextMenuProvider(menu, subject));
+ }
+
+private:
+ CustomContextMenuProvider(HTMLMenuElement&, HTMLElement&);
+ virtual ~CustomContextMenuProvider();
+
+ virtual void populateContextMenu(ContextMenu*) OVERRIDE;
+ virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE;
+ virtual void contextMenuCleared() OVERRIDE;
+ void populateContextMenuItems(const HTMLMenuElement&, ContextMenu&);
+ HTMLElement* menuItemAt(unsigned menuId);
+
+ RefPtrWillBePersistent<HTMLMenuElement> m_menu;
+ RefPtrWillBePersistent<HTMLElement> m_subjectElement;
+ WillBePersistentHeapVector<RefPtrWillBeMember<HTMLElement> > m_menuItems;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « Source/core/page/ContextMenuControllerTest.cpp ('k') | Source/core/page/CustomContextMenuProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698