Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: Source/core/page/CustomContextMenuProvider.cpp

Issue 766863002: Implement checked attribute for menuitem. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/ContextMenuControllerTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/CustomContextMenuProvider.cpp
diff --git a/Source/core/page/CustomContextMenuProvider.cpp b/Source/core/page/CustomContextMenuProvider.cpp
index 3b1ca8f6061983eca0ef3be686460571f3104927..0dcb6767c0312aac578c450cc5a7419cffb43cbb 100644
--- a/Source/core/page/CustomContextMenuProvider.cpp
+++ b/Source/core/page/CustomContextMenuProvider.cpp
@@ -80,7 +80,13 @@ void CustomContextMenuProvider::appendMenuItem(HTMLMenuItemElement* menuItem, Co
return;
m_menuItems.append(menuItem);
- contextMenu.appendItem(ContextMenuItem(ActionType, static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + m_menuItems.size() - 1), labelString, !menuItem->fastHasAttribute(disabledAttr), false));
+
+ bool enabled = !menuItem->fastHasAttribute(disabledAttr);
+ ContextMenuAction action = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + m_menuItems.size() - 1);
+ if (equalIgnoringCase(menuItem->fastGetAttribute(typeAttr), "checkbox"))
+ contextMenu.appendItem(ContextMenuItem(CheckableActionType, action, labelString, enabled, menuItem->fastHasAttribute(checkedAttr)));
+ else
+ contextMenu.appendItem(ContextMenuItem(ActionType, action, labelString, enabled, false));
}
void CustomContextMenuProvider::populateContextMenuItems(const HTMLMenuElement& menu, ContextMenu& contextMenu)
« no previous file with comments | « Source/core/page/ContextMenuControllerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698