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_AUTOCOMPLETE_MATCH_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/prerender/prerender_handle.h" | |
13 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 class AutocompleteProvider; | 17 class AutocompleteProvider; |
17 class Profile; | 18 class Profile; |
18 class TemplateURL; | 19 class TemplateURL; |
19 | 20 |
20 // AutocompleteMatch ---------------------------------------------------------- | 21 // AutocompleteMatch ---------------------------------------------------------- |
21 | 22 |
22 // A single result line with classified spans. The autocomplete popup displays | 23 // A single result line with classified spans. The autocomplete popup displays |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 // accesses it must perform any necessary sanity checks before blindly using | 268 // accesses it must perform any necessary sanity checks before blindly using |
268 // it! | 269 // it! |
269 string16 keyword; | 270 string16 keyword; |
270 | 271 |
271 // True if the user has starred the destination URL. | 272 // True if the user has starred the destination URL. |
272 bool starred; | 273 bool starred; |
273 | 274 |
274 // True if this match is from a previous result. | 275 // True if this match is from a previous result. |
275 bool from_previous; | 276 bool from_previous; |
276 | 277 |
278 // The prerender (if any) associated with this match. | |
279 mutable prerender::WeakPrerenderHandle prerender; | |
dominich
2012/06/18 15:32:44
I thought we discussed this at length and decided
| |
280 | |
277 #ifndef NDEBUG | 281 #ifndef NDEBUG |
278 // Does a data integrity check on this match. | 282 // Does a data integrity check on this match. |
279 void Validate() const; | 283 void Validate() const; |
280 | 284 |
281 // Checks one text/classifications pair for valid values. | 285 // Checks one text/classifications pair for valid values. |
282 void ValidateClassifications( | 286 void ValidateClassifications( |
283 const string16& text, | 287 const string16& text, |
284 const ACMatchClassifications& classifications) const; | 288 const ACMatchClassifications& classifications) const; |
285 #endif | 289 #endif |
286 }; | 290 }; |
287 | 291 |
288 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; | 292 typedef AutocompleteMatch::ACMatchClassification ACMatchClassification; |
289 typedef std::vector<ACMatchClassification> ACMatchClassifications; | 293 typedef std::vector<ACMatchClassification> ACMatchClassifications; |
290 | 294 |
291 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ | 295 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_MATCH_H_ |
OLD | NEW |