| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_CONTENTS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
| 9 #include "chrome/browser/history/history.h" | 9 #include "chrome/browser/history/history.h" |
| 10 | 10 |
| 11 namespace bookmark_utils { | 11 namespace bookmark_utils { |
| 12 struct TitleMatch; | 12 struct TitleMatch; |
| 13 } | 13 } |
| 14 | 14 |
| 15 // HistoryContentsProvider is an AutocompleteProvider that provides results from | 15 // HistoryContentsProvider is an AutocompleteProvider that provides results from |
| 16 // the contents (body and/or title) of previously visited pages. | 16 // the contents (body and/or title) of previously visited pages. |
| 17 // HistoryContentsProvider gets results from two sources: | 17 // HistoryContentsProvider gets results from two sources: |
| 18 // . HistoryService: this provides results for matches in the body/title of | 18 // . HistoryService: this provides results for matches in the body/title of |
| 19 // previously viewed pages. This is asynchronous. | 19 // previously viewed pages. This is asynchronous. |
| 20 // . BookmarkModel: provides results for matches in the titles of bookmarks. | 20 // . BookmarkModel: provides results for matches in the titles of bookmarks. |
| 21 // This is synchronous. | 21 // This is synchronous. |
| 22 class HistoryContentsProvider : public AutocompleteProvider { | 22 class HistoryContentsProvider : public AutocompleteProvider { |
| 23 public: | 23 public: |
| 24 HistoryContentsProvider(ACProviderListener* listener, Profile* profile) | 24 HistoryContentsProvider(ACProviderListener* listener, Profile* profile) |
| 25 : AutocompleteProvider(listener, profile, "HistoryContents"), | 25 : AutocompleteProvider(listener, profile, "HistoryContents"), |
| 26 star_title_count_(0), |
| 27 star_contents_count_(0), |
| 28 title_count_(0), |
| 29 contents_count_(0), |
| 30 input_type_(AutocompleteInput::INVALID), |
| 31 trim_http_(false), |
| 26 have_results_(false) { | 32 have_results_(false) { |
| 27 } | 33 } |
| 28 | 34 |
| 29 // As necessary asks the history service for the relevant results. When | 35 // As necessary asks the history service for the relevant results. When |
| 30 // done SetResults is invoked. | 36 // done SetResults is invoked. |
| 31 virtual void Start(const AutocompleteInput& input, | 37 virtual void Start(const AutocompleteInput& input, |
| 32 bool minimal_changes); | 38 bool minimal_changes); |
| 33 | 39 |
| 34 virtual void Stop(); | 40 virtual void Stop(); |
| 35 | 41 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Whether results_ is valid (so we can tell invalid apart from empty). | 99 // Whether results_ is valid (so we can tell invalid apart from empty). |
| 94 bool have_results_; | 100 bool have_results_; |
| 95 | 101 |
| 96 // Current query string. | 102 // Current query string. |
| 97 std::wstring query_; | 103 std::wstring query_; |
| 98 | 104 |
| 99 DISALLOW_EVIL_CONSTRUCTORS(HistoryContentsProvider); | 105 DISALLOW_EVIL_CONSTRUCTORS(HistoryContentsProvider); |
| 100 }; | 106 }; |
| 101 | 107 |
| 102 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ | 108 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ |
| OLD | NEW |