| 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 // 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 explicit HistoryQuickProvider(Profile* profile); | 30 explicit HistoryQuickProvider(Profile* profile); |
| 31 | 31 |
| 32 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch | 32 // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch |
| 33 // completion performed. | 33 // completion performed. |
| 34 void Start(const AutocompleteInput& input, bool minimal_changes) override; | 34 void Start(const AutocompleteInput& input, |
| 35 bool minimal_changes, |
| 36 bool called_due_to_focus) override; |
| 35 | 37 |
| 36 // Disable this provider. For unit testing purposes only. This is required | 38 // Disable this provider. For unit testing purposes only. This is required |
| 37 // because this provider is closely associated with the HistoryURLProvider | 39 // because this provider is closely associated with the HistoryURLProvider |
| 38 // and in order to properly test the latter the HistoryQuickProvider must | 40 // and in order to properly test the latter the HistoryQuickProvider must |
| 39 // be disabled. | 41 // be disabled. |
| 40 // TODO(mrossetti): Eliminate this once the HUP has been refactored. | 42 // TODO(mrossetti): Eliminate this once the HUP has been refactored. |
| 41 static void set_disabled(bool disabled) { disabled_ = disabled; } | 43 static void set_disabled(bool disabled) { disabled_ = disabled; } |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 friend class HistoryQuickProviderTest; | 46 friend class HistoryQuickProviderTest; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 70 // Only used for testing. | 72 // Only used for testing. |
| 71 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 73 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
| 72 | 74 |
| 73 // This provider is disabled when true. | 75 // This provider is disabled when true. |
| 74 static bool disabled_; | 76 static bool disabled_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); | 78 DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 81 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
| OLD | NEW |