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

Unified Diff: content/browser/renderer_host/webmenurunner_mac.mm

Issue 99043003: Fix typeahead for popup menu with attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/webmenurunner_mac.mm
diff --git a/content/browser/renderer_host/webmenurunner_mac.mm b/content/browser/renderer_host/webmenurunner_mac.mm
index a81d2c9e2f642b0299a07de5f8612dc4b997c5c3..1da1b49d5e456b3cfaf7b2ec348e0910a71b2d91 100644
--- a/content/browser/renderer_host/webmenurunner_mac.mm
+++ b/content/browser/renderer_host/webmenurunner_mac.mm
@@ -82,6 +82,13 @@
[[NSAttributedString alloc] initWithString:title attributes:attrs]);
[menuItem setAttributedTitle:attrTitle];
+ // We set the title as well as the attributed title here. The attributed title
+ // will be displayed in the menu, but typeahead will use the non-attributed
+ // string that doesn't contain any leading or trailing whitespace. This is
+ // what Apple uses in WebKit as well.
Avi (use Gerrit) 2013/12/02 14:53:06 If you're referring to "what Apple uses in WebKit"
+ NSCharacterSet* whitespaceSet = [NSCharacterSet whitespaceCharacterSet];
+ [menuItem setTitle:[title stringByTrimmingCharactersInSet:whitespaceSet]];
+
[menuItem setTag:[menu_ numberOfItems] - 1];
}
« 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