| 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_SEARCH_ENGINES_TEMPLATE_URL_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 int prepopulate_id; | 345 int prepopulate_id; |
| 346 | 346 |
| 347 // The primary unique identifier for Sync. This set on all TemplateURLs | 347 // The primary unique identifier for Sync. This set on all TemplateURLs |
| 348 // regardless of whether they have been associated with Sync. | 348 // regardless of whether they have been associated with Sync. |
| 349 std::string sync_guid; | 349 std::string sync_guid; |
| 350 | 350 |
| 351 // A list of URL patterns that can be used, in addition to |url_|, to extract | 351 // A list of URL patterns that can be used, in addition to |url_|, to extract |
| 352 // search terms from a URL. | 352 // search terms from a URL. |
| 353 std::vector<std::string> alternate_urls; | 353 std::vector<std::string> alternate_urls; |
| 354 | 354 |
| 355 // A parameter that, if present in the query or ref parameters of a search_url |
| 356 // or instant_url, causes Chrome to replace the URL with the search term. |
| 357 std::string search_terms_replacement_key; |
| 358 |
| 355 private: | 359 private: |
| 356 // Private so we can enforce using the setters and thus enforce that these | 360 // Private so we can enforce using the setters and thus enforce that these |
| 357 // fields are never empty. | 361 // fields are never empty. |
| 358 string16 keyword_; | 362 string16 keyword_; |
| 359 std::string url_; | 363 std::string url_; |
| 360 }; | 364 }; |
| 361 | 365 |
| 362 | 366 |
| 363 // TemplateURL ---------------------------------------------------------------- | 367 // TemplateURL ---------------------------------------------------------------- |
| 364 | 368 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 base::Time last_modified() const { return data_.last_modified; } | 424 base::Time last_modified() const { return data_.last_modified; } |
| 421 | 425 |
| 422 bool created_by_policy() const { return data_.created_by_policy; } | 426 bool created_by_policy() const { return data_.created_by_policy; } |
| 423 | 427 |
| 424 int usage_count() const { return data_.usage_count; } | 428 int usage_count() const { return data_.usage_count; } |
| 425 | 429 |
| 426 int prepopulate_id() const { return data_.prepopulate_id; } | 430 int prepopulate_id() const { return data_.prepopulate_id; } |
| 427 | 431 |
| 428 const std::string& sync_guid() const { return data_.sync_guid; } | 432 const std::string& sync_guid() const { return data_.sync_guid; } |
| 429 | 433 |
| 434 const std::string& search_terms_replacement_key() const { |
| 435 return data_.search_terms_replacement_key; |
| 436 } |
| 437 |
| 430 const TemplateURLRef& url_ref() const { return url_ref_; } | 438 const TemplateURLRef& url_ref() const { return url_ref_; } |
| 431 const TemplateURLRef& suggestions_url_ref() const { | 439 const TemplateURLRef& suggestions_url_ref() const { |
| 432 return suggestions_url_ref_; | 440 return suggestions_url_ref_; |
| 433 } | 441 } |
| 434 const TemplateURLRef& instant_url_ref() const { return instant_url_ref_; } | 442 const TemplateURLRef& instant_url_ref() const { return instant_url_ref_; } |
| 435 | 443 |
| 436 // Returns true if |url| supports replacement. | 444 // Returns true if |url| supports replacement. |
| 437 bool SupportsReplacement() const; | 445 bool SupportsReplacement() const; |
| 438 | 446 |
| 439 // Like SupportsReplacement but usable on threads other than the UI thread. | 447 // Like SupportsReplacement but usable on threads other than the UI thread. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 TemplateURLRef url_ref_; | 502 TemplateURLRef url_ref_; |
| 495 TemplateURLRef suggestions_url_ref_; | 503 TemplateURLRef suggestions_url_ref_; |
| 496 TemplateURLRef instant_url_ref_; | 504 TemplateURLRef instant_url_ref_; |
| 497 | 505 |
| 498 // TODO(sky): Add date last parsed OSD file. | 506 // TODO(sky): Add date last parsed OSD file. |
| 499 | 507 |
| 500 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 508 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
| 501 }; | 509 }; |
| 502 | 510 |
| 503 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 511 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
| OLD | NEW |