OLD | NEW |
(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 |
| 18 class CustomContextMenuProvider FINAL : public ContextMenuProvider { |
| 19 public: |
| 20 static PassRefPtr<CustomContextMenuProvider> create(HTMLMenuElement& menu, H
TMLElement& subject) |
| 21 { |
| 22 return adoptRef(new CustomContextMenuProvider(menu, subject)); |
| 23 } |
| 24 |
| 25 private: |
| 26 CustomContextMenuProvider(HTMLMenuElement&, HTMLElement&); |
| 27 virtual ~CustomContextMenuProvider(); |
| 28 |
| 29 virtual void populateContextMenu(ContextMenu*) OVERRIDE; |
| 30 virtual void contextMenuItemSelected(const ContextMenuItem*) OVERRIDE; |
| 31 virtual void contextMenuCleared() OVERRIDE; |
| 32 void populateContextMenuItems(const HTMLMenuElement&, ContextMenu&); |
| 33 HTMLElement* menuItemAt(unsigned menuId); |
| 34 |
| 35 RefPtrWillBePersistent<HTMLMenuElement> m_menu; |
| 36 RefPtrWillBePersistent<HTMLElement> m_subjectElement; |
| 37 WillBePersistentHeapVector<RefPtrWillBeMember<HTMLElement> > m_menuItems; |
| 38 }; |
| 39 |
| 40 } // namespace blink |
| 41 |
| 42 #endif |
OLD | NEW |