| 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 contains the keyword autocomplete provider. The keyword provider | 5 // This file contains the keyword autocomplete provider. The keyword provider |
| 6 // is responsible for remembering/suggesting user "search keyword queries" | 6 // is responsible for remembering/suggesting user "search keyword queries" |
| 7 // (e.g. "imdb Godzilla") and then fixing them up into valid URLs. An | 7 // (e.g. "imdb Godzilla") and then fixing them up into valid URLs. An |
| 8 // instance of it gets created and managed by the autocomplete controller. | 8 // instance of it gets created and managed by the autocomplete controller. |
| 9 // KeywordProvider uses a TemplateURLService to find the set of keywords. | 9 // KeywordProvider uses a TemplateURLService to find the set of keywords. |
| 10 // | 10 // |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const string16& keyword, | 126 const string16& keyword, |
| 127 const AutocompleteInput& input, | 127 const AutocompleteInput& input, |
| 128 size_t prefix_length, | 128 size_t prefix_length, |
| 129 const string16& remaining_input, | 129 const string16& remaining_input, |
| 130 int relevance); | 130 int relevance); |
| 131 | 131 |
| 132 void EnterExtensionKeywordMode(const std::string& extension_id); | 132 void EnterExtensionKeywordMode(const std::string& extension_id); |
| 133 void MaybeEndExtensionKeywordMode(); | 133 void MaybeEndExtensionKeywordMode(); |
| 134 | 134 |
| 135 // NotificationObserver interface. | 135 // NotificationObserver interface. |
| 136 virtual void Observe(NotificationType type, | 136 virtual void Observe(int type, |
| 137 const NotificationSource& source, | 137 const NotificationSource& source, |
| 138 const NotificationDetails& details); | 138 const NotificationDetails& details); |
| 139 | 139 |
| 140 // Model for the keywords. This is only non-null when testing, otherwise the | 140 // Model for the keywords. This is only non-null when testing, otherwise the |
| 141 // TemplateURLService from the Profile is used. | 141 // TemplateURLService from the Profile is used. |
| 142 TemplateURLService* model_; | 142 TemplateURLService* model_; |
| 143 | 143 |
| 144 // Identifies the current input state. This is incremented each time the | 144 // Identifies the current input state. This is incremented each time the |
| 145 // autocomplete edit's input changes in any way. It is used to tell whether | 145 // autocomplete edit's input changes in any way. It is used to tell whether |
| 146 // suggest results from the extension are current. | 146 // suggest results from the extension are current. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 157 // If non-empty, holds the ID of the extension whose keyword is currently in | 157 // If non-empty, holds the ID of the extension whose keyword is currently in |
| 158 // the URL bar while the autocomplete popup is open. | 158 // the URL bar while the autocomplete popup is open. |
| 159 std::string current_keyword_extension_id_; | 159 std::string current_keyword_extension_id_; |
| 160 | 160 |
| 161 NotificationRegistrar registrar_; | 161 NotificationRegistrar registrar_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(KeywordProvider); | 163 DISALLOW_COPY_AND_ASSIGN(KeywordProvider); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_PROVIDER_H_ | 166 #endif // CHROME_BROWSER_AUTOCOMPLETE_KEYWORD_PROVIDER_H_ |
| OLD | NEW |