| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/search_engines/template_url_data.h" | 5 #include "components/search_engines/template_url_data.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 | 13 |
| 14 TemplateURLData::TemplateURLData() | 14 TemplateURLData::TemplateURLData() |
| 15 : safe_for_autoreplace(false), | 15 : safe_for_autoreplace(false), |
| 16 id(0), | 16 id(0), |
| 17 date_created(base::Time::Now()), | 17 date_created(base::Time::Now()), |
| 18 last_modified(base::Time::Now()), | 18 last_modified(base::Time::Now()), |
| 19 last_visited(base::Time()), |
| 19 created_by_policy(false), | 20 created_by_policy(false), |
| 20 usage_count(0), | 21 usage_count(0), |
| 21 prepopulate_id(0), | 22 prepopulate_id(0), |
| 22 sync_guid(base::GenerateGUID()), | 23 sync_guid(base::GenerateGUID()), |
| 23 keyword_(base::ASCIIToUTF16("dummy")), | 24 keyword_(base::ASCIIToUTF16("dummy")), |
| 24 url_("x") {} | 25 url_("x") {} |
| 25 | 26 |
| 26 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; | 27 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; |
| 27 | 28 |
| 28 TemplateURLData::TemplateURLData(const base::string16& name, | 29 TemplateURLData::TemplateURLData(const base::string16& name, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 90 |
| 90 // Case sensitive keyword matching is confusing. As such, we force all | 91 // Case sensitive keyword matching is confusing. As such, we force all |
| 91 // keywords to be lower case. | 92 // keywords to be lower case. |
| 92 keyword_ = base::i18n::ToLower(keyword); | 93 keyword_ = base::i18n::ToLower(keyword); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void TemplateURLData::SetURL(const std::string& url) { | 96 void TemplateURLData::SetURL(const std::string& url) { |
| 96 DCHECK(!url.empty()); | 97 DCHECK(!url.empty()); |
| 97 url_ = url; | 98 url_ = url; |
| 98 } | 99 } |
| OLD | NEW |