Chromium Code Reviews| Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
| =================================================================== |
| --- chrome/browser/ui/views/omnibox/omnibox_view_win.cc (revision 84514) |
| +++ 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()) { |
| @@ -1720,7 +1723,8 @@ |
| void OmniboxViewWin::OnPaste() { |
| // Replace the selection if we have something to paste. |
| - const string16 text(GetClipboardText()); |
| + string16 text(GetClipboardText()); |
| + StripJavascriptSchema(text, &text); |
|
Peter Kasting
2011/05/10 23:27:42
You should be doing this fixup in GetClipboardText
Cris Neckar
2011/05/11 21:42:36
Done.
|
| if (!text.empty()) { |
| // Record this paste, so we can do different behavior. |
| model_->on_paste(); |