Chromium Code Reviews| Index: base/string_util.cc |
| =================================================================== |
| --- base/string_util.cc (revision 84514) |
| +++ base/string_util.cc (working copy) |
| @@ -910,6 +910,17 @@ |
| return result; |
| } |
| +bool StripJavascriptSchema(const string16& text, string16* out) { |
| + const string16 kJsSchema(ASCIIToUTF16("javascript:")); |
|
Avi (use Gerrit)
2011/05/10 23:41:06
Plus, when you move this out of base, like pkastin
Cris Neckar
2011/05/11 21:42:36
Done.
|
| + bool changed = false; |
| + *out = text; |
| + while (StartsWith(*out, kJsSchema, false)) { |
| + changed = true; |
| + TrimWhitespace(out->substr(kJsSchema.length()), TRIM_LEADING, out); |
| + } |
| + return changed; |
| +} |
| + |
| static bool IsWildcard(base_icu::UChar32 character) { |
| return character == '*' || character == '?'; |
| } |