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

Side by Side Diff: chrome/common/gtk_util.cc

Issue 203078: Escape ampersands in web view text selection for right click context menu so ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/common/gtk_util.h" 5 #include "chrome/common/gtk_util.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 9
10 #include <cstdarg> 10 #include <cstdarg>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 GtkWidget* centering_vbox = gtk_vbox_new(FALSE, 0); 260 GtkWidget* centering_vbox = gtk_vbox_new(FALSE, 0);
261 gtk_box_pack_start(GTK_BOX(centering_vbox), widget, TRUE, FALSE, 0); 261 gtk_box_pack_start(GTK_BOX(centering_vbox), widget, TRUE, FALSE, 0);
262 if (pack_at_end) 262 if (pack_at_end)
263 gtk_box_pack_end(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding); 263 gtk_box_pack_end(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding);
264 else 264 else
265 gtk_box_pack_start(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding); 265 gtk_box_pack_start(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding);
266 } 266 }
267 267
268 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label) { 268 std::string ConvertAcceleratorsFromWindowsStyle(const std::string& label) {
269 std::string ret; 269 std::string ret;
270 ret.reserve(label.length()); 270 ret.reserve(label.length() * 2);
271 for (size_t i = 0; i < label.length(); ++i) { 271 for (size_t i = 0; i < label.length(); ++i) {
272 if ('&' == label[i]) { 272 if ('_' == label[i]) {
273 ret.push_back('_');
274 ret.push_back('_');
275 } else if ('&' == label[i]) {
273 if (i + 1 < label.length() && '&' == label[i + 1]) { 276 if (i + 1 < label.length() && '&' == label[i + 1]) {
274 ret.push_back(label[i]); 277 ret.push_back(label[i]);
275 ++i; 278 ++i;
276 } else { 279 } else {
277 ret.push_back('_'); 280 ret.push_back('_');
278 } 281 }
279 } else { 282 } else {
280 ret.push_back(label[i]); 283 ret.push_back(label[i]);
281 } 284 }
282 } 285 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 532 }
530 #endif 533 #endif
531 } 534 }
532 535
533 GdkCursor* GetCursor(GdkCursorType type) { 536 GdkCursor* GetCursor(GdkCursorType type) {
534 static GdkCursorCache impl; 537 static GdkCursorCache impl;
535 return impl.GetCursorImpl(type); 538 return impl.GetCursorImpl(type);
536 } 539 }
537 540
538 } // namespace gtk_util 541 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698