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,23 @@ |
+// 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); |
+ for (; StartsWith(out, kJsPrefix, false); |
Peter Kasting
2011/05/24 19:34:59
Nit: Now that we no longer have |changed|, using a
Cris Neckar
2011/05/24 22:22:35
Done.
|
+ TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out)) { } |
Peter Kasting
2011/05/24 19:34:59
Nit: If you keep this as a for loop, indent to jus
Cris Neckar
2011/05/24 22:22:35
I changed this back to a while loop. I actually tr
|
+ return out; |
+} |
+ |
+ |