| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Converts |type| to a string representation. Used in logging. | 165 // Converts |type| to a string representation. Used in logging. |
| 166 static std::string TypeToString(Type type); | 166 static std::string TypeToString(Type type); |
| 167 | 167 |
| 168 // Parses |text| and returns the type of input this will be interpreted as. | 168 // Parses |text| and returns the type of input this will be interpreted as. |
| 169 // The components of the input are stored in the output parameter |parts|. | 169 // The components of the input are stored in the output parameter |parts|. |
| 170 static Type Parse(const std::wstring& text, | 170 static Type Parse(const std::wstring& text, |
| 171 const std::wstring& desired_tld, | 171 const std::wstring& desired_tld, |
| 172 url_parse::Parsed* parts, | 172 url_parse::Parsed* parts, |
| 173 std::wstring* scheme); | 173 std::wstring* scheme); |
| 174 | 174 |
| 175 // Parses |text| and fill |scheme| and |host| by the positions of them. |
| 176 // The results are almost as same as the result of Parse(), but if the scheme |
| 177 // is view-source, this function returns the positions of scheme and host |
| 178 // in the URL qualified by "view-source:" prefix. |
| 179 static void ParseForEmphasizeComponents(const std::wstring& text, |
| 180 const std::wstring& desired_tld, |
| 181 url_parse::Component* scheme, |
| 182 url_parse::Component* host); |
| 183 |
| 175 // User-provided text to be completed. | 184 // User-provided text to be completed. |
| 176 const std::wstring& text() const { return text_; } | 185 const std::wstring& text() const { return text_; } |
| 177 | 186 |
| 178 // Use of this setter is risky, since no other internal state is updated | 187 // Use of this setter is risky, since no other internal state is updated |
| 179 // besides |text_|. Only callers who know that they're not changing the | 188 // besides |text_|. Only callers who know that they're not changing the |
| 180 // type/scheme/etc. should use this. | 189 // type/scheme/etc. should use this. |
| 181 void set_text(const std::wstring& text) { text_ = text; } | 190 void set_text(const std::wstring& text) { text_ = text; } |
| 182 | 191 |
| 183 // The type of input supplied. | 192 // The type of input supplied. |
| 184 Type type() const { return type_; } | 193 Type type() const { return type_; } |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 AutocompleteInput::Type input_type; | 812 AutocompleteInput::Type input_type; |
| 804 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). | 813 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). |
| 805 size_t selected_index; | 814 size_t selected_index; |
| 806 // Inline autocompleted length (if displayed). | 815 // Inline autocompleted length (if displayed). |
| 807 size_t inline_autocompleted_length; | 816 size_t inline_autocompleted_length; |
| 808 // Result set. | 817 // Result set. |
| 809 const AutocompleteResult& result; | 818 const AutocompleteResult& result; |
| 810 }; | 819 }; |
| 811 | 820 |
| 812 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 821 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| OLD | NEW |