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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 10386085: Support 'Paste and Go' action in omnibox Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index b68b2751e42c5a739161ff7e3b0cc3fe24d888ad..6561894c02a486ffa52e10596c7e64a8315d527f 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -2450,42 +2450,6 @@ void OmniboxViewWin::TextChanged() {
model_->OnChanged();
}
-string16 OmniboxViewWin::GetClipboardText() const {
- // Try text format.
- ui::Clipboard* clipboard = g_browser_process->clipboard();
- if (clipboard->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
- ui::Clipboard::BUFFER_STANDARD)) {
- string16 text;
- clipboard->ReadText(ui::Clipboard::BUFFER_STANDARD, &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
- // lines in terminals, email programs, etc., and so linebreaks indicate
- // completely bogus whitespace that would just cause the input to be
- // invalid.
- return StripJavascriptSchemas(CollapseWhitespace(text, true));
- }
-
- // Try bookmark format.
- //
- // It is tempting to try bookmark format first, but the URL we get out of a
- // bookmark has been cannonicalized via GURL. This means if a user copies
- // and pastes from the URL bar to itself, the text will get fixed up and
- // cannonicalized, which is not what the user expects. By pasting in this
- // order, we are sure to paste what the user copied.
- if (clipboard->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(),
- ui::Clipboard::BUFFER_STANDARD)) {
- std::string url_str;
- clipboard->ReadBookmark(NULL, &url_str);
- // pass resulting url string through GURL to normalize
- GURL url(url_str);
- if (url.is_valid())
- return StripJavascriptSchemas(UTF8ToUTF16(url.spec()));
- }
-
- return string16();
-}
-
bool OmniboxViewWin::CanPasteAndGo(const string16& text) const {
return !popup_window_mode_ && model_->CanPasteAndGo(text);
}
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698