| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef ContextMenuController_h | 26 #ifndef ContextMenuController_h |
| 27 #define ContextMenuController_h | 27 #define ContextMenuController_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/layout/HitTestResult.h" | 30 #include "core/layout/HitTestResult.h" |
| 31 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
| 32 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 33 #include "wtf/OwnPtr.h" | |
| 34 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
| 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class ContextMenu; | 39 class ContextMenu; |
| 40 class ContextMenuClient; | 40 class ContextMenuClient; |
| 41 class ContextMenuItem; | 41 class ContextMenuItem; |
| 42 class ContextMenuProvider; | 42 class ContextMenuProvider; |
| 43 class Document; | 43 class Document; |
| 44 class Event; | 44 class Event; |
| 45 class LocalFrame; | 45 class LocalFrame; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 void showContextMenu(Event*, ContextMenuProvider*); | 61 void showContextMenu(Event*, ContextMenuProvider*); |
| 62 void showContextMenuAtPoint(LocalFrame*, float x, float y, ContextMenuProvid
er*); | 62 void showContextMenuAtPoint(LocalFrame*, float x, float y, ContextMenuProvid
er*); |
| 63 | 63 |
| 64 void contextMenuItemSelected(const ContextMenuItem*); | 64 void contextMenuItemSelected(const ContextMenuItem*); |
| 65 | 65 |
| 66 const HitTestResult& hitTestResult() { return m_hitTestResult; } | 66 const HitTestResult& hitTestResult() { return m_hitTestResult; } |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 ContextMenuController(Page*, ContextMenuClient*); | 69 ContextMenuController(Page*, ContextMenuClient*); |
| 70 | 70 |
| 71 PassOwnPtr<ContextMenu> createContextMenu(Event*); | 71 std::unique_ptr<ContextMenu> createContextMenu(Event*); |
| 72 PassOwnPtr<ContextMenu> createContextMenu(LocalFrame*, const LayoutPoint&); | 72 std::unique_ptr<ContextMenu> createContextMenu(LocalFrame*, const LayoutPoin
t&); |
| 73 void populateCustomContextMenu(const Event&); | 73 void populateCustomContextMenu(const Event&); |
| 74 void showContextMenu(Event*); | 74 void showContextMenu(Event*); |
| 75 | 75 |
| 76 ContextMenuClient* m_client; | 76 ContextMenuClient* m_client; |
| 77 OwnPtr<ContextMenu> m_contextMenu; | 77 std::unique_ptr<ContextMenu> m_contextMenu; |
| 78 Member<ContextMenuProvider> m_menuProvider; | 78 Member<ContextMenuProvider> m_menuProvider; |
| 79 HitTestResult m_hitTestResult; | 79 HitTestResult m_hitTestResult; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| 83 | 83 |
| 84 #endif // ContextMenuController_h | 84 #endif // ContextMenuController_h |
| OLD | NEW |