OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // | 38 // |
39 // IMPORTANT: There is NO THREAD SAFETY built into this portion of the | 39 // IMPORTANT: There is NO THREAD SAFETY built into this portion of the |
40 // autocomplete system. All calls to and from the AutocompleteController should | 40 // autocomplete system. All calls to and from the AutocompleteController should |
41 // happen on the same thread. AutocompleteProviders are responsible for doing | 41 // happen on the same thread. AutocompleteProviders are responsible for doing |
42 // their own thread management when they need to return matches asynchronously. | 42 // their own thread management when they need to return matches asynchronously. |
43 // | 43 // |
44 // The coordinator for autocomplete queries, responsible for combining the | 44 // The coordinator for autocomplete queries, responsible for combining the |
45 // matches from a series of providers into one AutocompleteResult. | 45 // matches from a series of providers into one AutocompleteResult. |
46 class AutocompleteController : public AutocompleteProviderListener { | 46 class AutocompleteController : public AutocompleteProviderListener { |
47 public: | 47 public: |
48 // Used to indicate an index that is not selected in a call to Update(). | |
49 static const int kNoItemSelected; | |
50 | |
51 // |provider_types| is a bitmap containing AutocompleteProvider::Type values | 48 // |provider_types| is a bitmap containing AutocompleteProvider::Type values |
52 // that will (potentially, depending on platform, flags, etc.) be | 49 // that will (potentially, depending on platform, flags, etc.) be |
53 // instantiated. | 50 // instantiated. |
54 AutocompleteController(Profile* profile, | 51 AutocompleteController(Profile* profile, |
55 AutocompleteControllerDelegate* delegate, | 52 AutocompleteControllerDelegate* delegate, |
56 int provider_types); | 53 int provider_types); |
57 ~AutocompleteController(); | 54 ~AutocompleteController(); |
58 | 55 |
59 // Starts an autocomplete query, which continues until all providers are | 56 // Starts an autocomplete query, which continues until all providers are |
60 // done or the query is Stop()ed. It is safe to Start() a new query without | 57 // done or the query is Stop()ed. It is safe to Start() a new query without |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 237 |
241 // Has StartZeroSuggest() been called but not Start()? | 238 // Has StartZeroSuggest() been called but not Start()? |
242 bool in_zero_suggest_; | 239 bool in_zero_suggest_; |
243 | 240 |
244 Profile* profile_; | 241 Profile* profile_; |
245 | 242 |
246 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 243 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
247 }; | 244 }; |
248 | 245 |
249 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ | 246 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CONTROLLER_H_ |
OLD | NEW |