| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/autocomplete/autocomplete_match.h" | 12 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 13 #include "chrome/browser/autocomplete/history_provider.h" | 13 #include "chrome/browser/autocomplete/history_provider.h" |
| 14 #include "chrome/browser/history/history_types.h" | 14 #include "chrome/browser/history/history_types.h" |
| 15 #include "chrome/browser/history/in_memory_url_index.h" | 15 #include "chrome/browser/history/in_memory_url_index.h" |
| 16 #include "components/autocomplete/autocomplete_input.h" | 16 #include "components/autocomplete/autocomplete_input.h" |
| 17 | 17 |
| 18 class Profile; | 18 class Profile; |
| 19 | 19 |
| 20 namespace history { | 20 namespace history { |
| 21 class ScoredHistoryMatch; | 21 class ScoredHistoryMatch; |
| 22 } // namespace history | 22 } // namespace history |
| 23 | 23 |
| 24 // This class is an autocomplete provider (a pseudo-internal component of | 24 // This class is an autocomplete provider (a pseudo-internal component of |
| 25 // the history system) which quickly (and synchronously) provides matching | 25 // the history system) which quickly (and synchronously) provides matching |
| 26 // results from recently or frequently visited sites in the profile's | 26 // results from recently or frequently visited sites in the profile's |
| 27 // history. | 27 // history. |
| 28 class HistoryQuickProvider : public HistoryProvider { | 28 class HistoryQuickProvider : public HistoryProvider { |
| 29 public: | 29 public: |
| 30 HistoryQuickProvider(AutocompleteProviderListener* listener, | 30 explicit HistoryQuickProvider(Profile* profile); |
| 31 Profile* profile); | |
| 32 | 31 |
| 33 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch | 32 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch |
| 34 // completion performed. | 33 // completion performed. |
| 35 virtual void Start(const AutocompleteInput& input, | 34 virtual void Start(const AutocompleteInput& input, |
| 36 bool minimal_changes) OVERRIDE; | 35 bool minimal_changes) OVERRIDE; |
| 37 | 36 |
| 38 // Disable this provider. For unit testing purposes only. This is required | 37 // Disable this provider. For unit testing purposes only. This is required |
| 39 // because this provider is closely associated with the HistoryURLProvider | 38 // because this provider is closely associated with the HistoryURLProvider |
| 40 // and in order to properly test the latter the HistoryQuickProvider must | 39 // and in order to properly test the latter the HistoryQuickProvider must |
| 41 // be disabled. | 40 // be disabled. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 72 // Only used for testing. | 71 // Only used for testing. |
| 73 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 72 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
| 74 | 73 |
| 75 // This provider is disabled when true. | 74 // This provider is disabled when true. |
| 76 static bool disabled_; | 75 static bool disabled_; |
| 77 | 76 |
| 78 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 77 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 80 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
| OLD | NEW |