OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 history::InMemoryURLIndex* GetIndex(); | 74 history::InMemoryURLIndex* GetIndex(); |
75 | 75 |
76 // Fill and return an ACMatchClassifications structure given the term | 76 // Fill and return an ACMatchClassifications structure given the term |
77 // matches (|matches|) to highlight where terms were found. | 77 // matches (|matches|) to highlight where terms were found. |
78 static ACMatchClassifications SpansFromTermMatch( | 78 static ACMatchClassifications SpansFromTermMatch( |
79 const history::TermMatches& matches, | 79 const history::TermMatches& matches, |
80 size_t text_length, | 80 size_t text_length, |
81 bool is_url); | 81 bool is_url); |
82 | 82 |
83 // Only for use in unittests. Takes ownership of |index|. | 83 // Only for use in unittests. Takes ownership of |index|. |
84 void SetIndexForTesting(history::InMemoryURLIndex* index); | 84 void set_index(history::InMemoryURLIndex* index) { |
| 85 index_for_testing_.reset(index); |
| 86 } |
| 87 |
85 AutocompleteInput autocomplete_input_; | 88 AutocompleteInput autocomplete_input_; |
86 std::string languages_; | 89 std::string languages_; |
87 | 90 |
88 // Only used for testing. | 91 // Only used for testing. |
89 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; | 92 scoped_ptr<history::InMemoryURLIndex> index_for_testing_; |
90 | 93 |
91 // This provider is disabled when true. | 94 // This provider is disabled when true. |
92 static bool disabled_; | 95 static bool disabled_; |
93 }; | 96 }; |
94 | 97 |
95 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ | 98 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_ |
OLD | NEW |