Chromium Code Reviews| 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]; |
| } |