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

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: Comments addressed 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
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..d16d54138901d9d5955ca7486fec8c7cb0e281d9 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 newlines are converted to spaces.
Peter Kasting 2013/08/09 18:11:59 Nit: "...this case, runs of whitespace are collaps
jfweitz 2013/08/09 18:49:55 Done.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698