| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "ContextMenuItem.h" | 32 #include "ContextMenuItem.h" |
| 33 | 33 |
| 34 #include "ContextMenu.h" | 34 #include "NotImplemented.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 // This is a stub implementation of WebKit's ContextMenu class that does | 38 // This is a stub implementation of WebKit's ContextMenu class that does |
| 39 // nothing. | 39 // nothing. |
| 40 | 40 void* ContextMenuItem::platformContextMenuItem() const |
| 41 ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item) | |
| 42 { | 41 { |
| 43 } | 42 notImplemented(); |
| 44 | 43 return 0; |
| 45 ContextMenuItem::ContextMenuItem(ContextMenu* subMenu) | |
| 46 { | |
| 47 } | |
| 48 | |
| 49 ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction act
ion, const String& title, ContextMenu* subMenu) | |
| 50 { | |
| 51 m_platformDescription.type = type; | |
| 52 m_platformDescription.action = action; | |
| 53 m_platformDescription.title = title; | |
| 54 if (subMenu) | |
| 55 setSubMenu(subMenu); | |
| 56 } | |
| 57 | |
| 58 ContextMenuItem::~ContextMenuItem() | |
| 59 { | |
| 60 } | |
| 61 | |
| 62 PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription() | |
| 63 { | |
| 64 return m_platformDescription; | |
| 65 } | |
| 66 | |
| 67 ContextMenuItemType ContextMenuItem::type() const | |
| 68 { | |
| 69 return m_platformDescription.type; | |
| 70 } | |
| 71 | |
| 72 ContextMenuAction ContextMenuItem::action() const | |
| 73 { | |
| 74 return m_platformDescription.action; | |
| 75 } | |
| 76 | |
| 77 String ContextMenuItem::title() const | |
| 78 { | |
| 79 return m_platformDescription.title; | |
| 80 } | |
| 81 | |
| 82 bool ContextMenuItem::checked() const | |
| 83 { | |
| 84 return m_platformDescription.checked; | |
| 85 } | |
| 86 | |
| 87 bool ContextMenuItem::enabled() const | |
| 88 { | |
| 89 return m_platformDescription.enabled; | |
| 90 } | |
| 91 | |
| 92 PlatformMenuDescription ContextMenuItem::platformSubMenu() const | |
| 93 { | |
| 94 return &m_platformDescription.subMenuItems; | |
| 95 } | |
| 96 | |
| 97 void ContextMenuItem::setType(ContextMenuItemType type) | |
| 98 { | |
| 99 m_platformDescription.type = type; | |
| 100 } | |
| 101 | |
| 102 void ContextMenuItem::setAction(ContextMenuAction action) | |
| 103 { | |
| 104 m_platformDescription.action = action; | |
| 105 } | |
| 106 | |
| 107 void ContextMenuItem::setTitle(const String& title) | |
| 108 { | |
| 109 m_platformDescription.title = title; | |
| 110 } | |
| 111 | |
| 112 void ContextMenuItem::setSubMenu(ContextMenu* menu) | |
| 113 { | |
| 114 m_platformDescription.subMenuItems = *menu->platformDescription(); | |
| 115 } | |
| 116 | |
| 117 void ContextMenuItem::setSubMenu(Vector<ContextMenuItem>& items) | |
| 118 { | |
| 119 m_platformDescription.subMenuItems = items; | |
| 120 } | |
| 121 | |
| 122 void ContextMenuItem::setChecked(bool checked) | |
| 123 { | |
| 124 m_platformDescription.checked = checked; | |
| 125 } | |
| 126 | |
| 127 void ContextMenuItem::setEnabled(bool enabled) | |
| 128 { | |
| 129 m_platformDescription.enabled = enabled; | |
| 130 } | 44 } |
| 131 | 45 |
| 132 } // namespace WebCore | 46 } // namespace WebCore |
| OLD | NEW |