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_TEMPLATE_URL_H__ | 5 #ifndef CHROME_BROWSER_TEMPLATE_URL_H__ |
6 #define CHROME_BROWSER_TEMPLATE_URL_H__ | 6 #define CHROME_BROWSER_TEMPLATE_URL_H__ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 }; | 248 }; |
249 | 249 |
250 // Generates a favicon URL from the specified url. | 250 // Generates a favicon URL from the specified url. |
251 static GURL GenerateFaviconURL(const GURL& url); | 251 static GURL GenerateFaviconURL(const GURL& url); |
252 | 252 |
253 TemplateURL() | 253 TemplateURL() |
254 : autogenerate_keyword_(false), | 254 : autogenerate_keyword_(false), |
255 show_in_default_list_(false), | 255 show_in_default_list_(false), |
256 safe_for_autoreplace_(false), | 256 safe_for_autoreplace_(false), |
257 id_(0), | 257 id_(0), |
258 date_created_(Time::Now()), | 258 date_created_(base::Time::Now()), |
259 usage_count_(0), | 259 usage_count_(0), |
260 prepopulate_id_(0) {} | 260 prepopulate_id_(0) {} |
261 ~TemplateURL() {} | 261 ~TemplateURL() {} |
262 | 262 |
263 // A short description of the template. This is the name we show to the user | 263 // A short description of the template. This is the name we show to the user |
264 // in various places that use keywords. For example, the location bar shows | 264 // in various places that use keywords. For example, the location bar shows |
265 // this when the user selects the keyword. | 265 // this when the user selects the keyword. |
266 void set_short_name(const std::wstring& short_name) { | 266 void set_short_name(const std::wstring& short_name) { |
267 short_name_ = short_name; | 267 short_name_ = short_name; |
268 } | 268 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // Set of languages supported. This may be empty. | 361 // Set of languages supported. This may be empty. |
362 void add_language(const std::wstring& language) { | 362 void add_language(const std::wstring& language) { |
363 languages_.push_back(language); | 363 languages_.push_back(language); |
364 } | 364 } |
365 const std::vector<std::wstring>& languages() const { return languages_; } | 365 const std::vector<std::wstring>& languages() const { return languages_; } |
366 | 366 |
367 // Date this keyword was created. | 367 // Date this keyword was created. |
368 // | 368 // |
369 // NOTE: this may be 0, which indicates the keyword was created before we | 369 // NOTE: this may be 0, which indicates the keyword was created before we |
370 // started tracking creation time. | 370 // started tracking creation time. |
371 void set_date_created(Time time) { date_created_ = time; } | 371 void set_date_created(base::Time time) { date_created_ = time; } |
372 Time date_created() const { return date_created_; } | 372 base::Time date_created() const { return date_created_; } |
373 | 373 |
374 // Number of times this keyword has been explicitly used to load a URL. We | 374 // Number of times this keyword has been explicitly used to load a URL. We |
375 // don't increment this for uses as the "default search engine" since that's | 375 // don't increment this for uses as the "default search engine" since that's |
376 // not really "explicit" usage and incrementing would result in pinning the | 376 // not really "explicit" usage and incrementing would result in pinning the |
377 // user's default search engine(s) to the top of the list of searches on the | 377 // user's default search engine(s) to the top of the list of searches on the |
378 // New Tab page, de-emphasizing the omnibox as "where you go to search". | 378 // New Tab page, de-emphasizing the omnibox as "where you go to search". |
379 void set_usage_count(int count) { usage_count_ = count; } | 379 void set_usage_count(int count) { usage_count_ = count; } |
380 int usage_count() const { return usage_count_; } | 380 int usage_count() const { return usage_count_; } |
381 | 381 |
382 // The list of supported encodings for the search terms. This may be empty, | 382 // The list of supported encodings for the search terms. This may be empty, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 mutable std::wstring keyword_; | 418 mutable std::wstring keyword_; |
419 bool autogenerate_keyword_; // If this is set, |keyword_| holds the cached | 419 bool autogenerate_keyword_; // If this is set, |keyword_| holds the cached |
420 // generated keyword if available. | 420 // generated keyword if available. |
421 bool show_in_default_list_; | 421 bool show_in_default_list_; |
422 bool safe_for_autoreplace_; | 422 bool safe_for_autoreplace_; |
423 std::vector<ImageRef> image_refs_; | 423 std::vector<ImageRef> image_refs_; |
424 std::vector<std::wstring> languages_; | 424 std::vector<std::wstring> languages_; |
425 // List of supported input encodings. | 425 // List of supported input encodings. |
426 std::vector<std::string> input_encodings_; | 426 std::vector<std::string> input_encodings_; |
427 IDType id_; | 427 IDType id_; |
428 Time date_created_; | 428 base::Time date_created_; |
429 int usage_count_; | 429 int usage_count_; |
430 int prepopulate_id_; | 430 int prepopulate_id_; |
431 | 431 |
432 // TODO(sky): Add date last parsed OSD file. | 432 // TODO(sky): Add date last parsed OSD file. |
433 }; | 433 }; |
434 | 434 |
435 #endif // CHROME_BROWSER_TEMPLATE_URL_PARSER_H__ | 435 #endif // CHROME_BROWSER_TEMPLATE_URL_PARSER_H__ |
436 | 436 |
OLD | NEW |