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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/CustomContextMenuProvider.h
diff --git a/Source/core/html/CustomContextMenuProvider.h b/Source/core/html/CustomContextMenuProvider.h
new file mode 100644
index 0000000000000000000000000000000000000000..b00c4bf584c6f3bc5fc028f36bf3e8d69a51159a
--- /dev/null
+++ b/Source/core/html/CustomContextMenuProvider.h
@@ -0,0 +1,46 @@
+// 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"
+
+namespace WebCore {
+
+class ContextMenu;
+class HTMLMenuElement;
+
+class CustomContextMenuProvider FINAL : public ContextMenuProvider {
+public:
+ static PassRefPtr<CustomContextMenuProvider> create(HTMLMenuElement* menu, const Vector<ContextMenuItem>& items)
+ {
+ return adoptRef(new CustomContextMenuProvider(menu, items));
+ }
+
+private:
+ explicit CustomContextMenuProvider(HTMLMenuElement* menu, const Vector<ContextMenuItem>& 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.
+ : m_menu(menu)
+ , m_items(items)
+ {
+ }
+
+ virtual ~CustomContextMenuProvider()
Inactive 2014/07/16 20:07:25 nit: could be in the cpp
pals 2014/07/17 15:35:47 Done.
+ {
+ }
+
+ virtual void populateContextMenu(ContextMenu*) OVERRIDE;
+
+ virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE;
+
+ virtual void contextMenuCleared() OVERRIDE { }
+
+ RefPtr<HTMLMenuElement> m_menu;
+ Vector<ContextMenuItem> m_items;
+};
+
+} // namespace
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698