summaryrefslogtreecommitdiffstats
path: root/chrome/common/gtk_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 21:49:56 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-16 21:49:56 +0000
commitdfe0adbb3425f47c0236f5fc7b715ac4dc74312c (patch)
tree4e9d4c70f88719a28f7e1deb89e7fab5a95c0aa0 /chrome/common/gtk_util.cc
parent4bee23f2f19aa81bc95c662a56d8b3ec66d611de (diff)
downloadchromium_src-dfe0adbb3425f47c0236f5fc7b715ac4dc74312c.zip
chromium_src-dfe0adbb3425f47c0236f5fc7b715ac4dc74312c.tar.gz
chromium_src-dfe0adbb3425f47c0236f5fc7b715ac4dc74312c.tar.bz2
Escape ampersands in web view text selection for right click context menu so that they don't show up as mnemonics.
Also escape underscores in gtk menus so they don't show up as mnemonics (we use ampersands to match windows). BUG=14587 Review URL: http://codereview.chromium.org/203078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gtk_util.cc')
-rw-r--r--chrome/common/gtk_util.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc
index 007c24c..e88ceb7 100644
--- a/chrome/common/gtk_util.cc
+++ b/chrome/common/gtk_util.cc
@@ -267,9 +267,12 @@ void CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool pack_at_end,
std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label) {
std::string ret;
- ret.reserve(label.length());
+ ret.reserve(label.length() * 2);
for (size_t i = 0; i < label.length(); ++i) {
- if ('&' == label[i]) {
+ if ('_' == label[i]) {
+ ret.push_back('_');
+ ret.push_back('_');
+ } else if ('&' == label[i]) {
if (i + 1 < label.length() && '&' == label[i + 1]) {
ret.push_back(label[i]);
++i;