| 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_HISTORY_QUICK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // This class is an autocomplete provider (a pseudo-internal component of | 25 // This class is an autocomplete provider (a pseudo-internal component of |
| 26 // the history system) which quickly (and synchronously) provides matching | 26 // the history system) which quickly (and synchronously) provides matching |
| 27 // results from recently or frequently visited sites in the profile's | 27 // results from recently or frequently visited sites in the profile's |
| 28 // history. | 28 // history. |
| 29 class HistoryQuickProvider : public HistoryProvider { | 29 class HistoryQuickProvider : public HistoryProvider { |
| 30 public: | 30 public: |
| 31 HistoryQuickProvider(AutocompleteProviderListener* listener, | 31 HistoryQuickProvider(AutocompleteProviderListener* listener, |
| 32 Profile* profile); | 32 Profile* profile); |
| 33 | 33 |
| 34 // AutocompleteProvider. | 34 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch |
| 35 // completion performed. |
| 35 virtual void Start(const AutocompleteInput& input, | 36 virtual void Start(const AutocompleteInput& input, |
| 36 bool minimal_changes) OVERRIDE; | 37 bool minimal_changes) OVERRIDE; |
| 37 | 38 |
| 38 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | 39 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; |
| 39 | 40 |
| 40 // Disable this provider. For unit testing purposes only. This is required | 41 // Disable this provider. For unit testing purposes only. This is required |
| 41 // because this provider is closely associated with the HistoryURLProvider | 42 // because this provider is closely associated with the HistoryURLProvider |
| 42 // and in order to properly test the latter the HistoryQuickProvider must | 43 // and in order to properly test the latter the HistoryQuickProvider must |
| 43 // be disabled. | 44 // be disabled. |
| 44 // TODO(mrossetti): Eliminate this once the HUP has been refactored. | 45 // TODO(mrossetti): Eliminate this once the HUP has been refactored. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Only used for testing. | 100 // Only used for testing. |
| 100 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 101 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
| 101 | 102 |
| 102 // This provider is disabled when true. | 103 // This provider is disabled when true. |
| 103 static bool disabled_; | 104 static bool disabled_; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 106 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 109 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
| OLD | NEW |