OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file defines helper functions shared by the various implementations | |
6 // of OmniBoxView. | |
7 | |
8 #include "chrome\browser\ui\omnibox\omnibox_view.h" | |
Peter Kasting
2011/05/24 00:15:18
Slashes are wrong direction
Cris Neckar
2011/05/24 05:23:33
Done.
| |
9 | |
10 #include "base/string16.h" | |
11 #include "base/string_util.h" | |
12 #include "base/utf_string_conversions.h" | |
13 | |
14 namespace views { | |
15 | |
16 string16 StripJavascriptSchemas(const string16& text) { | |
17 const string16 kJsPrefix(ASCIIToUTF16(chrome::kJavaScriptScheme) + | |
18 ASCIIToUTF16(":")); | |
19 string16 out(text); | |
20 for (; StartsWith(out, kJsPrefix, false); | |
21 TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out)) { } | |
22 return out; | |
23 } | |
24 | |
25 } // namespace views | |
OLD | NEW |