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

Unified Diff: chrome/browser/ui/omnibox/omnibox_view.h

Issue 20501002: Adds paste function to searchbox api and handles paste event on fakebox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 7 years, 4 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/browser_instant_controller.cc ('k') | chrome/browser/ui/omnibox/omnibox_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_view.h
diff --git a/chrome/browser/ui/omnibox/omnibox_view.h b/chrome/browser/ui/omnibox/omnibox_view.h
index 9fb5b943a747f160e079815b65f32ba5156d46d4..a138de5727d63d1859e5a6f47edef63dfe5f68cb 100644
--- a/chrome/browser/ui/omnibox/omnibox_view.h
+++ b/chrome/browser/ui/omnibox/omnibox_view.h
@@ -231,10 +231,18 @@ class OmniboxView {
virtual int OnPerformDrop(const ui::DropTargetEvent& event) = 0;
#endif
- // Returns a string with any leading javascript schemas stripped from the
- // input text.
+ // Returns |text| with any leading javascript schemas stripped.
static string16 StripJavascriptSchemas(const string16& text);
+ // First, calls StripJavascriptSchemas(). Then automatically collapses
+ // internal whitespace as follows:
+ // * If the only whitespace in |text| is newlines, users are most likely
+ // pasting in URLs split into multiple lines by terminals, email programs,
+ // etc. So all newlines are removed.
+ // * Otherwise, users may be pasting in search data, e.g. street addresses. In
+ // this case, runs of whitespace are collapsed down to single spaces.
+ static string16 SanitizeTextForPaste(const string16& text);
+
// Returns the current clipboard contents as a string that can be pasted in.
// In addition to just getting CF_UNICODETEXT out, this can also extract URLs
// from bookmarks on the clipboard.
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.cc ('k') | chrome/browser/ui/omnibox/omnibox_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698