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 #include "config.h" | |
6 | |
7 #include "core/html/CustomContextMenuProvider.h" | |
8 | |
9 #include "core/html/HTMLMenuElement.h" | |
10 #include "platform/ContextMenu.h" | |
11 | |
12 namespace WebCore { | |
13 | |
14 void CustomContextMenuProvider::populateContextMenu(ContextMenu* menu) | |
15 { | |
16 for (size_t i = 0; i < m_items.size(); ++i) | |
17 menu->appendItem(m_items[i]); | |
18 } | |
19 | |
20 void CustomContextMenuProvider::contextMenuItemSelected(const ContextMenuItem* i tem) | |
21 { | |
22 if (m_menu) { | |
esprehn
2014/06/20 08:39:57
Early return instead.
if (!m_menu)
return;
if (
pals
2014/06/20 14:22:10
The spec says " If the command's Action is defined
| |
23 if (HTMLElement* element = m_menu->menuItemAt(item->action())) | |
24 element->click(); | |
25 } | |
26 } | |
27 | |
28 } // namespace | |
OLD | NEW |