Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines helper functions shared by the various implementations | 5 // This file defines helper functions shared by the various implementations |
| 6 // of OmniboxView. | 6 // of OmniboxView. |
| 7 | 7 |
| 8 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 | 13 |
| 14 string16 OmniboxView::StripJavascriptSchemas(const string16& text) { | 14 string16 OmniboxView::StripJavascriptSchemas(const string16& text) { |
| 15 const string16 kJsPrefix(ASCIIToUTF16(chrome::kJavaScriptScheme) + | 15 const string16 kJsPrefix(ASCIIToUTF16(chrome::kJavaScriptScheme) + |
| 16 ASCIIToUTF16(":")); | 16 ASCIIToUTF16(":")); |
| 17 string16 out(text); | 17 string16 out(text); |
| 18 while (StartsWith(out, kJsPrefix, false)) | 18 while (StartsWith(out, kJsPrefix, false)) |
| 19 TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out); | 19 TrimWhitespace(out.substr(kJsPrefix.length()), TRIM_LEADING, &out); |
| 20 return out; | 20 return out; |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool OmniboxView::ShouldHideAutocompletePopup() const { | |
|
sky
2011/10/13 15:58:02
Position doesn't match position in header.
| |
| 24 return false; | |
| 25 } | |
| OLD | NEW |