Automated Commit: Committing new LKGM version 6953.0.0 for chromeos.
[chromium-blink-merge.git] / components / search_engines / template_url_data.cc
blobfdbec7d7c00b05258e5274cf31096650d966d2d4
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
3 // found in the LICENSE file.
5 #include "components/search_engines/template_url_data.h"
7 #include "base/guid.h"
8 #include "base/i18n/case_conversion.h"
9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h"
12 TemplateURLData::TemplateURLData()
13 : show_in_default_list(false),
14 safe_for_autoreplace(false),
15 id(0),
16 date_created(base::Time::Now()),
17 last_modified(base::Time::Now()),
18 created_by_policy(false),
19 usage_count(0),
20 prepopulate_id(0),
21 sync_guid(base::GenerateGUID()),
22 keyword_(base::ASCIIToUTF16("dummy")),
23 url_("x") {
26 TemplateURLData::~TemplateURLData() {
29 void TemplateURLData::SetKeyword(const base::string16& keyword) {
30 DCHECK(!keyword.empty());
32 // Case sensitive keyword matching is confusing. As such, we force all
33 // keywords to be lower case.
34 keyword_ = base::i18n::ToLower(keyword);
37 void TemplateURLData::SetURL(const std::string& url) {
38 DCHECK(!url.empty());
39 url_ = url;