Chromium Code Reviews| 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 : safe_for_autoreplace(false), | 14 : safe_for_autoreplace(false), |
| 15 id(0), | 15 id(0), |
| 16 date_created(base::Time::Now()), | 16 date_created(base::Time::Now()), |
| 17 last_modified(base::Time::Now()), | 17 last_modified(base::Time::Now()), |
| 18 last_visited(base::Time::Now()), | |
|
Peter Kasting
2016/11/21 03:35:08
Seems wrong to set last_visited to Now() (instead
ltian
2016/11/28 22:08:02
I think it is related to how we define "recently v
| |
| 18 created_by_policy(false), | 19 created_by_policy(false), |
| 19 usage_count(0), | 20 usage_count(0), |
| 20 prepopulate_id(0), | 21 prepopulate_id(0), |
| 21 sync_guid(base::GenerateGUID()), | 22 sync_guid(base::GenerateGUID()), |
| 22 keyword_(base::ASCIIToUTF16("dummy")), | 23 keyword_(base::ASCIIToUTF16("dummy")), |
| 23 url_("x") {} | 24 url_("x") {} |
| 24 | 25 |
| 25 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; | 26 TemplateURLData::TemplateURLData(const TemplateURLData& other) = default; |
| 26 | 27 |
| 27 TemplateURLData::~TemplateURLData() { | 28 TemplateURLData::~TemplateURLData() { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 40 | 41 |
| 41 // Case sensitive keyword matching is confusing. As such, we force all | 42 // Case sensitive keyword matching is confusing. As such, we force all |
| 42 // keywords to be lower case. | 43 // keywords to be lower case. |
| 43 keyword_ = base::i18n::ToLower(keyword); | 44 keyword_ = base::i18n::ToLower(keyword); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void TemplateURLData::SetURL(const std::string& url) { | 47 void TemplateURLData::SetURL(const std::string& url) { |
| 47 DCHECK(!url.empty()); | 48 DCHECK(!url.empty()); |
| 48 url_ = url; | 49 url_ = url; |
| 49 } | 50 } |
| OLD | NEW |