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

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

Issue 6982011: Strip leading "javascript:" schemas from text pasted or dropped into the omnibox. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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/omnibox/omnibox_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.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.cc
===================================================================
--- chrome/browser/ui/omnibox/omnibox_view.cc (revision 0)
+++ chrome/browser/ui/omnibox/omnibox_view.cc (revision 0)
@@ -0,0 +1,22 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file defines helper functions shared by the various implementations
+// of OmniboxView.
+
+#include "chrome/browser/ui/omnibox/omnibox_view.h"
+
+#include "base/string_util.h"
+#include "base/string16.h"
+#include "base/utf_string_conversions.h"
+
+string16 OmniboxView::StripJavascriptSchemas(const string16& text) {
+ const string16 kJsPrefix(ASCIIToUTF16(chrome::kJavaScriptScheme) +
+ ASCIIToUTF16(":"));
+ string16 out(text);
+ while (StartsWith(out, kJsPrefix, false))
+ TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out);
+ return out;
+}
+
Property changes on: chrome\browser\ui\omnibox\omnibox_view.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698