OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ |
6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ | 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // Returns the set of matches for the current query. | 191 // Returns the set of matches for the current query. |
192 const ACMatches& matches() const { return matches_; } | 192 const ACMatches& matches() const { return matches_; } |
193 | 193 |
194 // Returns whether the provider is done processing the query. | 194 // Returns whether the provider is done processing the query. |
195 bool done() const { return done_; } | 195 bool done() const { return done_; } |
196 | 196 |
197 // Returns this provider's type. | 197 // Returns this provider's type. |
198 Type type() const { return type_; } | 198 Type type() const { return type_; } |
199 | 199 |
| 200 // Returns whether the provider wants to provide matches in response to the |
| 201 // omnibox being focused. |
| 202 virtual bool ProvidesMatchesOnOmniboxFocus() const; |
| 203 |
200 // Returns a string describing this provider's type. | 204 // Returns a string describing this provider's type. |
201 const char* GetName() const; | 205 const char* GetName() const; |
202 | 206 |
203 // A suggested upper bound for how many matches a provider should return. | 207 // A suggested upper bound for how many matches a provider should return. |
204 // TODO(pkasting): http://b/1111299 , http://b/933133 This should go away once | 208 // TODO(pkasting): http://b/1111299 , http://b/933133 This should go away once |
205 // we have good relevance heuristics; the controller should handle all | 209 // we have good relevance heuristics; the controller should handle all |
206 // culling. | 210 // culling. |
207 static const size_t kMaxMatches; | 211 static const size_t kMaxMatches; |
208 | 212 |
209 protected: | 213 protected: |
(...skipping 29 matching lines...) Expand all Loading... |
239 ACMatches matches_; | 243 ACMatches matches_; |
240 bool done_; | 244 bool done_; |
241 | 245 |
242 Type type_; | 246 Type type_; |
243 | 247 |
244 private: | 248 private: |
245 DISALLOW_COPY_AND_ASSIGN(AutocompleteProvider); | 249 DISALLOW_COPY_AND_ASSIGN(AutocompleteProvider); |
246 }; | 250 }; |
247 | 251 |
248 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ | 252 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_PROVIDER_H_ |
OLD | NEW |