OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_URL_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/compiler_specific.h" |
11 #include "chrome/browser/autocomplete/history_provider.h" | 12 #include "chrome/browser/autocomplete/history_provider.h" |
12 #include "chrome/browser/autocomplete/history_provider_util.h" | 13 #include "chrome/browser/autocomplete/history_provider_util.h" |
13 | 14 |
14 class MessageLoop; | 15 class MessageLoop; |
15 class Profile; | 16 class Profile; |
16 | 17 |
17 namespace history { | 18 namespace history { |
18 | 19 |
19 class HistoryBackend; | 20 class HistoryBackend; |
20 class URLDatabase; | 21 class URLDatabase; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 const std::string& languages) | 145 const std::string& languages) |
145 : HistoryProvider(listener, profile, "History"), | 146 : HistoryProvider(listener, profile, "History"), |
146 prefixes_(GetPrefixes()), | 147 prefixes_(GetPrefixes()), |
147 params_(NULL), | 148 params_(NULL), |
148 languages_(languages) {} | 149 languages_(languages) {} |
149 #endif | 150 #endif |
150 // no destructor (see note above) | 151 // no destructor (see note above) |
151 | 152 |
152 // AutocompleteProvider | 153 // AutocompleteProvider |
153 virtual void Start(const AutocompleteInput& input, | 154 virtual void Start(const AutocompleteInput& input, |
154 bool minimal_changes); | 155 bool minimal_changes) OVERRIDE; |
155 virtual void Stop(); | 156 virtual void Stop() OVERRIDE; |
156 virtual void DeleteMatch(const AutocompleteMatch& match); | |
157 | 157 |
158 // Runs the history query on the history thread, called by the history | 158 // Runs the history query on the history thread, called by the history |
159 // system. The history database MAY BE NULL in which case it is not | 159 // system. The history database MAY BE NULL in which case it is not |
160 // available and we should return no data. Also schedules returning the | 160 // available and we should return no data. Also schedules returning the |
161 // results to the main thread | 161 // results to the main thread |
162 void ExecuteWithDB(history::HistoryBackend* backend, | 162 void ExecuteWithDB(history::HistoryBackend* backend, |
163 history::URLDatabase* db, | 163 history::URLDatabase* db, |
164 HistoryURLProviderParams* params); | 164 HistoryURLProviderParams* params); |
165 | 165 |
166 // Actually runs the autocomplete job on the given database, which is | 166 // Actually runs the autocomplete job on the given database, which is |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // parameter itself is freed once it's no longer needed. The only reason we | 295 // parameter itself is freed once it's no longer needed. The only reason we |
296 // keep this member is so we can set the cancel bit on it. | 296 // keep this member is so we can set the cancel bit on it. |
297 HistoryURLProviderParams* params_; | 297 HistoryURLProviderParams* params_; |
298 | 298 |
299 // Only used by unittests; if non-empty, overrides accept-languages in the | 299 // Only used by unittests; if non-empty, overrides accept-languages in the |
300 // profile's pref system. | 300 // profile's pref system. |
301 std::string languages_; | 301 std::string languages_; |
302 }; | 302 }; |
303 | 303 |
304 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ | 304 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_URL_PROVIDER_H_ |
OLD | NEW |