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

Side by Side Diff: ui/base/gtk/menu_label_accelerator_util.cc

Issue 16402012: Use a direct include of strings headers in ui/, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/gtk/gtk_im_context_util.cc ('k') | ui/base/ime/character_composer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/gtk/menu_label_accelerator_util.h" 5 #include "ui/base/gtk/menu_label_accelerator_util.h"
6 6
7 #include "base/string_util.h" 7 #include "base/strings/string_util.h"
8 8
9 namespace { 9 namespace {
10 10
11 // Common implementation of ConvertAcceleratorsFromWindowsStyle() and 11 // Common implementation of ConvertAcceleratorsFromWindowsStyle() and
12 // RemoveWindowsStyleAccelerators(). 12 // RemoveWindowsStyleAccelerators().
13 // Replaces all ampersands (as used in our grd files to indicate mnemonics) 13 // Replaces all ampersands (as used in our grd files to indicate mnemonics)
14 // to |target|, except ampersands appearing in pairs which are replaced by 14 // to |target|, except ampersands appearing in pairs which are replaced by
15 // a single ampersand. Any underscores get replaced with two underscores as 15 // a single ampersand. Any underscores get replaced with two underscores as
16 // is needed by GTK. 16 // is needed by GTK.
17 std::string ConvertAmpersandsTo(const std::string& label, 17 std::string ConvertAmpersandsTo(const std::string& label,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // escapes strings for later processing by ConvertAmpersandsTo(), so that 53 // escapes strings for later processing by ConvertAmpersandsTo(), so that
54 // ConvertAmpersandsTo(EscapeWindowsStyleAccelerators(x), *) is |x| with 54 // ConvertAmpersandsTo(EscapeWindowsStyleAccelerators(x), *) is |x| with
55 // underscores doubled, making the string that appears to the user just |x|. 55 // underscores doubled, making the string that appears to the user just |x|.
56 std::string EscapeWindowsStyleAccelerators(const std::string& label) { 56 std::string EscapeWindowsStyleAccelerators(const std::string& label) {
57 std::string ret; 57 std::string ret;
58 ReplaceChars(label, "&", "&&", &ret); 58 ReplaceChars(label, "&", "&&", &ret);
59 return ret; 59 return ret;
60 } 60 }
61 61
62 } // namespace ui 62 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/gtk/gtk_im_context_util.cc ('k') | ui/base/ime/character_composer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698