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

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: Move to oilpan 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..da68abd57c6c9440aa4bb8a007b1e91e6e6957be
--- /dev/null
+++ b/Source/core/html/CustomContextMenuProvider.h
@@ -0,0 +1,41 @@
+// 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 HTMLMenuElement;
+
+class CustomContextMenuProvider FINAL : public ContextMenuProvider {
+public:
+ static PassRefPtrWillBeRawPtr<CustomContextMenuProvider> create(HTMLMenuElement* menu, const Vector<ContextMenuItem>& items)
tkent 2014/07/25 04:42:38 PassRefPtrWIllBeRawPtr -> PassRefPtr because Conte
pals 2014/07/30 09:47:43 Done.
+ {
+ return adoptRefWillBeNoop(new CustomContextMenuProvider(menu, items));
tkent 2014/07/25 04:42:38 adoptRefWIllBeNoop -> adoptRef
pals 2014/07/30 09:47:43 Done.
+ }
+
+private:
+ CustomContextMenuProvider(HTMLMenuElement* menu, const Vector<ContextMenuItem>& items);
tkent 2014/07/25 04:42:37 The first argument should be HTMLMenuElement&.
pals 2014/07/30 09:47:43 Changed to PassRefPtr.
+
tkent 2014/07/25 04:42:37 nit: Need no blank line
pals 2014/07/30 09:47:43 Done.
+ virtual ~CustomContextMenuProvider();
+
+ virtual void populateContextMenu(ContextMenu*) OVERRIDE;
+
tkent 2014/07/25 04:42:37 nit: Need no blank line
pals 2014/07/30 09:47:43 Done.
+ virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE;
+
tkent 2014/07/25 04:42:37 nit: Need no blank line
pals 2014/07/30 09:47:43 Done.
+ virtual void contextMenuCleared() OVERRIDE { }
+
+ RefPtrWillBeMember<HTMLMenuElement> m_menu;
tkent 2014/07/25 04:42:38 RefPtrWillBeMember -> RefPtrWillBePersistent
pals 2014/07/30 09:47:43 Done.
+ Vector<ContextMenuItem> m_items;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698