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 * Copyright (C) 2010 Igalia S.L | 3 * Copyright (C) 2010 Igalia S.L |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 { | 89 { |
90 if (!RuntimeEnabledFeatures::contextMenuEnabled()) | 90 if (!RuntimeEnabledFeatures::contextMenuEnabled()) |
91 return; | 91 return; |
92 | 92 |
93 Node* node = event.target()->toNode(); | 93 Node* node = event.target()->toNode(); |
94 if (!node || !node->isHTMLElement()) | 94 if (!node || !node->isHTMLElement()) |
95 return; | 95 return; |
96 | 96 |
97 HTMLElement& element = toHTMLElement(*node); | 97 HTMLElement& element = toHTMLElement(*node); |
98 RefPtrWillBeRawPtr<HTMLMenuElement> menuElement = element.assignedContextMen
u(); | 98 RefPtrWillBeRawPtr<HTMLMenuElement> menuElement = element.assignedContextMen
u(); |
99 if (!menuElement || !equalIgnoringCase(menuElement->fastGetAttribute(typeAtt
r), "popup")) | 99 if (!menuElement || !equalIgnoringCase(menuElement->fastGetAttribute(typeAtt
r), "context")) |
100 return; | 100 return; |
101 RefPtrWillBeRawPtr<RelatedEvent> relatedEvent = RelatedEvent::create(EventTy
peNames::show, true, true, node); | 101 RefPtrWillBeRawPtr<RelatedEvent> relatedEvent = RelatedEvent::create(EventTy
peNames::show, true, true, node); |
102 if (!menuElement->dispatchEvent(relatedEvent.release())) | 102 if (!menuElement->dispatchEvent(relatedEvent.release())) |
103 return; | 103 return; |
104 if (menuElement != element.assignedContextMenu()) | 104 if (menuElement != element.assignedContextMenu()) |
105 return; | 105 return; |
106 m_menuProvider = CustomContextMenuProvider::create(*menuElement, element); | 106 m_menuProvider = CustomContextMenuProvider::create(*menuElement, element); |
107 m_menuProvider->populateContextMenu(m_contextMenu.get()); | 107 m_menuProvider->populateContextMenu(m_contextMenu.get()); |
108 } | 108 } |
109 | 109 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 ASSERT(item->type() == ActionType || item->type() == CheckableActionType); | 184 ASSERT(item->type() == ActionType || item->type() == CheckableActionType); |
185 | 185 |
186 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex
tMenuItemLastCustomTag) | 186 if (item->action() < ContextMenuItemBaseCustomTag || item->action() > Contex
tMenuItemLastCustomTag) |
187 return; | 187 return; |
188 | 188 |
189 ASSERT(m_menuProvider); | 189 ASSERT(m_menuProvider); |
190 m_menuProvider->contextMenuItemSelected(item); | 190 m_menuProvider->contextMenuItemSelected(item); |
191 } | 191 } |
192 | 192 |
193 } // namespace blink | 193 } // namespace blink |
OLD | NEW |