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

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

Issue 502993002: Updating MakeMenuItemStringsFor() to include separators in custom items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making separator look special Created 6 years, 4 months 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 79071bfddfba42e27a0859165e2bf16ab63bdac8..e4db3f913027c7ca6332ea027e788336ab31cefd 100644
--- a/content/shell/renderer/test_runner/event_sender.cc
+++ b/content/shell/renderer/test_runner/event_sender.cc
@@ -124,6 +124,7 @@ const double kMultipleClickTimeSec = 1;
const int kMultipleClickRadiusPixels = 5;
const char kSubMenuDepthIdentifier[] = "_";
const char kSubMenuIdentifier[] = " >";
+const char kSeparatorIdentifier[] = "---------";
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)) >
@@ -133,7 +134,9 @@ 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) {
- if (customItems[i].type == blink::WebMenuItemInfo::SubMenu) {
+ if (customItems[i].type == blink::WebMenuItemInfo::Separator) {
+ strings->push_back(prefix + kSeparatorIdentifier);
+ } else if (customItems[i].type == blink::WebMenuItemInfo::SubMenu) {
strings->push_back(prefix + customItems[i].label.utf8() +
kSubMenuIdentifier);
PopulateCustomItems(customItems[i].subMenuItems, prefix +
« 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