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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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"
9
10 #include "base/string_util.h"
11 #include "base/string16.h"
12 #include "base/utf_string_conversions.h"
13
14 string16 OmniboxView::StripJavascriptSchemas(const string16& text) {
15 const string16 kJsPrefix(ASCIIToUTF16(chrome::kJavaScriptScheme) +
16 ASCIIToUTF16(":"));
17 string16 out(text);
18 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.
19 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
20 return out;
21 }
22
23
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698