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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Collects metrics whether searches through Google are sent with RLZ string. | 135 // Collects metrics whether searches through Google are sent with RLZ string. |
136 void CollectRLZMetrics() const; | 136 void CollectRLZMetrics() const; |
137 | 137 |
138 private: | 138 private: |
139 friend class SearchHostToURLsMapTest; | 139 friend class SearchHostToURLsMapTest; |
140 friend class TemplateURL; | 140 friend class TemplateURL; |
141 friend class TemplateURLServiceTestUtil; | 141 friend class TemplateURLServiceTestUtil; |
142 friend class TemplateURLTest; | 142 friend class TemplateURLTest; |
143 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterKnown); | 143 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterKnown); |
144 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterUnknown); | 144 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterUnknown); |
| 145 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseParameterReallyUnknown); |
145 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLEmpty); | 146 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLEmpty); |
146 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoTemplateEnd); | 147 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoTemplateEnd); |
147 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoKnownParameters); | 148 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNoKnownParameters); |
148 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); | 149 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); |
149 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); | 150 FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); |
150 | 151 |
151 // Enumeration of the known types. | 152 // Enumeration of the known types. |
152 enum ReplacementType { | 153 enum ReplacementType { |
153 ENCODING, | 154 ENCODING, |
154 GOOGLE_ACCEPTED_SUGGESTION, | 155 GOOGLE_ACCEPTED_SUGGESTION, |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 419 } |
419 std::vector<string16> languages() const { return languages_; } | 420 std::vector<string16> languages() const { return languages_; } |
420 | 421 |
421 // Date this keyword was created. | 422 // Date this keyword was created. |
422 // | 423 // |
423 // NOTE: this may be 0, which indicates the keyword was created before we | 424 // NOTE: this may be 0, which indicates the keyword was created before we |
424 // started tracking creation time. | 425 // started tracking creation time. |
425 void set_date_created(base::Time time) { date_created_ = time; } | 426 void set_date_created(base::Time time) { date_created_ = time; } |
426 base::Time date_created() const { return date_created_; } | 427 base::Time date_created() const { return date_created_; } |
427 | 428 |
| 429 // The last time this keyword was modified by a user, since creation. |
| 430 // |
| 431 // NOTE: Like date_created above, this may be 0. |
| 432 void set_last_modified(base::Time time) { last_modified_ = time; } |
| 433 base::Time last_modified() const { return last_modified_; } |
| 434 |
428 // True if this TemplateURL was automatically created by the administrator via | 435 // True if this TemplateURL was automatically created by the administrator via |
429 // group policy. | 436 // group policy. |
430 void set_created_by_policy(bool created_by_policy) { | 437 void set_created_by_policy(bool created_by_policy) { |
431 created_by_policy_ = created_by_policy; | 438 created_by_policy_ = created_by_policy; |
432 } | 439 } |
433 bool created_by_policy() const { return created_by_policy_; } | 440 bool created_by_policy() const { return created_by_policy_; } |
434 | 441 |
435 // Number of times this keyword has been explicitly used to load a URL. We | 442 // Number of times this keyword has been explicitly used to load a URL. We |
436 // don't increment this for uses as the "default search engine" since that's | 443 // don't increment this for uses as the "default search engine" since that's |
437 // not really "explicit" usage and incrementing would result in pinning the | 444 // not really "explicit" usage and incrementing would result in pinning the |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // is used to avoid multiple attempts if | 510 // is used to avoid multiple attempts if |
504 // generating a keyword failed. | 511 // generating a keyword failed. |
505 bool show_in_default_list_; | 512 bool show_in_default_list_; |
506 bool safe_for_autoreplace_; | 513 bool safe_for_autoreplace_; |
507 std::vector<ImageRef> image_refs_; | 514 std::vector<ImageRef> image_refs_; |
508 std::vector<string16> languages_; | 515 std::vector<string16> languages_; |
509 // List of supported input encodings. | 516 // List of supported input encodings. |
510 std::vector<std::string> input_encodings_; | 517 std::vector<std::string> input_encodings_; |
511 TemplateURLID id_; | 518 TemplateURLID id_; |
512 base::Time date_created_; | 519 base::Time date_created_; |
| 520 base::Time last_modified_; |
513 bool created_by_policy_; | 521 bool created_by_policy_; |
514 int usage_count_; | 522 int usage_count_; |
515 SearchEngineType search_engine_type_; | 523 SearchEngineType search_engine_type_; |
516 int logo_id_; | 524 int logo_id_; |
517 int prepopulate_id_; | 525 int prepopulate_id_; |
518 | 526 |
519 // TODO(sky): Add date last parsed OSD file. | 527 // TODO(sky): Add date last parsed OSD file. |
520 }; | 528 }; |
521 | 529 |
522 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ | 530 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |