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

Unified Diff: content/shell/renderer/test_runner/event_sender.cc

Issue 750713004: Updating MakeMenuItemStringsFor() to mark disabled and checked menuitems. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/event_sender.cc
diff --git a/content/shell/renderer/test_runner/event_sender.cc b/content/shell/renderer/test_runner/event_sender.cc
index 4c90eb413004dc5e1644f4fbda21b9a952ef0053..f298b844988ed86e28b00ba6e46adad4b9d75240 100644
--- a/content/shell/renderer/test_runner/event_sender.cc
+++ b/content/shell/renderer/test_runner/event_sender.cc
@@ -125,6 +125,8 @@ const int kMultipleClickRadiusPixels = 5;
const char kSubMenuDepthIdentifier[] = "_";
const char kSubMenuIdentifier[] = " >";
const char kSeparatorIdentifier[] = "---------";
+const char kDisabledIdentifier[] = "#";
+const char kCheckedIdentifier[] = "*";
bool OutsideMultiClickRadius(const WebPoint& a, const WebPoint& b) {
return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)) >
@@ -134,15 +136,20 @@ bool OutsideMultiClickRadius(const WebPoint& a, const WebPoint& b) {
void PopulateCustomItems(const WebVector<WebMenuItemInfo>& customItems,
const std::string& prefix, std::vector<std::string>* strings) {
for (size_t i = 0; i < customItems.size(); ++i) {
+ std::string prefixCopy = prefix;
+ if (!customItems[i].enabled)
+ prefixCopy = kDisabledIdentifier + prefix;
+ if (customItems[i].checked)
+ prefixCopy = kCheckedIdentifier + prefix;
if (customItems[i].type == blink::WebMenuItemInfo::Separator) {
- strings->push_back(prefix + kSeparatorIdentifier);
+ strings->push_back(prefixCopy + kSeparatorIdentifier);
} else if (customItems[i].type == blink::WebMenuItemInfo::SubMenu) {
- strings->push_back(prefix + customItems[i].label.utf8() +
+ strings->push_back(prefixCopy + customItems[i].label.utf8() +
kSubMenuIdentifier);
- PopulateCustomItems(customItems[i].subMenuItems, prefix +
+ PopulateCustomItems(customItems[i].subMenuItems, prefixCopy +
kSubMenuDepthIdentifier, strings);
} else {
- strings->push_back(prefix + customItems[i].label.utf8());
+ strings->push_back(prefixCopy + customItems[i].label.utf8());
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698