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"
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),
16 date_created(base::Time::Now()),
17 last_modified(base::Time::Now()),
18 created_by_policy(false),
21 sync_guid(base::GenerateGUID()),
22 keyword_(base::ASCIIToUTF16("dummy")),
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
) {