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

Unified Diff: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc

Issue 8513002: Strip invalid characters (line breaks, tabs), javascript:schemes from the copied text before pasting (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc (revision 109588)
+++ chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc (working copy)
@@ -1444,7 +1444,9 @@
// back after shutdown, and similar issues.
GtkClipboard* x_clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
gchar* text = gtk_clipboard_wait_for_text(x_clipboard);
- string16 text_wstr = UTF8ToUTF16(text ? text : "");
+ string16 sanitized_text(text ?
+ StripJavascriptSchemas(CollapseWhitespace(UTF8ToUTF16(text), true)) :
+ string16());
g_free(text);
// Paste and Go menu item.
@@ -1456,7 +1458,7 @@
g_signal_connect(paste_go_menuitem, "activate",
G_CALLBACK(HandlePasteAndGoThunk), this);
gtk_widget_set_sensitive(paste_go_menuitem,
- model_->CanPasteAndGo(text_wstr));
+ model_->CanPasteAndGo(sanitized_text));
Peter Kasting 2011/11/15 07:26:12 This call still needs to be moved up before the ca
SanjoyPal 2011/11/15 12:42:37 Done.
gtk_widget_show(paste_go_menuitem);
g_signal_connect(menu, "deactivate",
« 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