| 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 | 12 |
| 13 TemplateURLData::TemplateURLData() | 13 TemplateURLData::TemplateURLData() |
| 14 : show_in_default_list(false), | 14 : show_in_default_list(false), |
| 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 created_by_policy(false), | 19 created_by_policy(false), |
| 20 usage_count(0), | 20 usage_count(0), |
| 21 engine_type(SEARCH_ENGINE_UNKNOWN), |
| 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 | 27 |
| 27 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; | 28 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; |
| 28 | 29 |
| 29 TemplateURLData::~TemplateURLData() { | 30 TemplateURLData::~TemplateURLData() { |
| 30 } | 31 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 // Case sensitive keyword matching is confusing. As such, we force all | 44 // Case sensitive keyword matching is confusing. As such, we force all |
| 44 // keywords to be lower case. | 45 // keywords to be lower case. |
| 45 keyword_ = base::i18n::ToLower(keyword); | 46 keyword_ = base::i18n::ToLower(keyword); |
| 46 } | 47 } |
| 47 | 48 |
| 48 void TemplateURLData::SetURL(const std::string& url) { | 49 void TemplateURLData::SetURL(const std::string& url) { |
| 49 DCHECK(!url.empty()); | 50 DCHECK(!url.empty()); |
| 50 url_ = url; | 51 url_ = url; |
| 51 } | 52 } |
| OLD | NEW |