| Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/omnibox/omnibox_view_win.cc (revision 85569)
|
| +++ chrome/browser/ui/views/omnibox/omnibox_view_win.cc (working copy)
|
| @@ -958,8 +958,11 @@
|
| GURL url;
|
| string16 title;
|
| if (data.GetURLAndTitle(&url, &title)) {
|
| - SetUserText(UTF8ToWide(url.spec()));
|
| - model()->AcceptInput(CURRENT_TAB, true);
|
| + string16 text(UTF8ToUTF16(url.spec()));
|
| + bool changed = StripJavascriptSchema(text, &text);
|
| + SetUserText(text);
|
| + if (!changed)
|
| + model()->AcceptInput(CURRENT_TAB, true);
|
| return CopyOrLinkDragOperation(event.source_operations());
|
| }
|
| } else if (data.HasString()) {
|
| @@ -2356,7 +2359,7 @@
|
| ui::Clipboard::BUFFER_STANDARD)) {
|
| string16 text;
|
| clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &text);
|
| -
|
| + StripJavascriptSchema(text, &text);
|
| // Note: Unlike in the find popup and textfield view, here we completely
|
| // remove whitespace strings containing newlines. We assume users are
|
| // most likely pasting in URLs that may have been split into multiple
|
| @@ -2376,11 +2379,13 @@
|
| if (clipboard->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(),
|
| ui::Clipboard::BUFFER_STANDARD)) {
|
| std::string url_str;
|
| + string16 text;
|
| clipboard->ReadBookmark(NULL, &url_str);
|
| // pass resulting url string through GURL to normalize
|
| GURL url(url_str);
|
| if (url.is_valid())
|
| - return UTF8ToWide(url.spec());
|
| + StripJavascriptSchema(UTF8ToUTF16(url.spec()), &text);
|
| + return text;
|
| }
|
|
|
| return string16();
|
|
|