| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/autocomplete/autocomplete.h" | 5 #include "chrome/browser/autocomplete/autocomplete.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 case URL: return "url"; | 76 case URL: return "url"; |
| 77 case QUERY: return "query"; | 77 case QUERY: return "query"; |
| 78 case FORCED_QUERY: return "forced-query"; | 78 case FORCED_QUERY: return "forced-query"; |
| 79 | 79 |
| 80 default: | 80 default: |
| 81 NOTREACHED(); | 81 NOTREACHED(); |
| 82 return std::string(); | 82 return std::string(); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 //static | 86 // static |
| 87 AutocompleteInput::Type AutocompleteInput::Parse( | 87 AutocompleteInput::Type AutocompleteInput::Parse( |
| 88 const std::wstring& text, | 88 const std::wstring& text, |
| 89 const std::wstring& desired_tld, | 89 const std::wstring& desired_tld, |
| 90 url_parse::Parsed* parts, | 90 url_parse::Parsed* parts, |
| 91 std::wstring* scheme) { | 91 std::wstring* scheme) { |
| 92 DCHECK(parts); | 92 DCHECK(parts); |
| 93 | 93 |
| 94 const size_t first_non_white = text.find_first_not_of(kWhitespaceWide, 0); | 94 const size_t first_non_white = text.find_first_not_of(kWhitespaceWide, 0); |
| 95 if (first_non_white == std::wstring::npos) | 95 if (first_non_white == std::wstring::npos) |
| 96 return INVALID; // All whitespace. | 96 return INVALID; // All whitespace. |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 void AutocompleteController::CheckIfDone() { | 919 void AutocompleteController::CheckIfDone() { |
| 920 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); | 920 for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end(); |
| 921 ++i) { | 921 ++i) { |
| 922 if (!(*i)->done()) { | 922 if (!(*i)->done()) { |
| 923 done_ = false; | 923 done_ = false; |
| 924 return; | 924 return; |
| 925 } | 925 } |
| 926 } | 926 } |
| 927 done_ = true; | 927 done_ = true; |
| 928 } | 928 } |
| OLD | NEW |