OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/search_engines/template_url.h" | 5 #include "chrome/browser/search_engines/template_url.h" |
6 | 6 |
| 7 #include "base/guid.h" |
7 #include "base/i18n/case_conversion.h" | 8 #include "base/i18n/case_conversion.h" |
8 #include "base/i18n/icu_string_conversions.h" | 9 #include "base/i18n/icu_string_conversions.h" |
9 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
12 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
13 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" | 16 #include "chrome/browser/autocomplete/autocomplete_field_trial.h" |
16 #include "chrome/browser/google/google_util.h" | 17 #include "chrome/browser/google/google_util.h" |
17 #include "chrome/browser/search_engines/search_terms_data.h" | 18 #include "chrome/browser/search_engines/search_terms_data.h" |
18 #include "chrome/browser/search_engines/template_url_service.h" | 19 #include "chrome/browser/search_engines/template_url_service.h" |
19 #include "chrome/common/guid.h" | |
20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
21 #include "net/base/escape.h" | 21 #include "net/base/escape.h" |
22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // The TemplateURLRef has any number of terms that need to be replaced. Each of | 26 // The TemplateURLRef has any number of terms that need to be replaced. Each of |
27 // the terms is enclosed in braces. If the character preceeding the final | 27 // the terms is enclosed in braces. If the character preceeding the final |
28 // brace is a ?, it indicates the term is optional and can be replaced with | 28 // brace is a ?, it indicates the term is optional and can be replaced with |
29 // an empty string. | 29 // an empty string. |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 data_.SetKeyword(TemplateURLService::GenerateKeyword(url)); | 686 data_.SetKeyword(TemplateURLService::GenerateKeyword(url)); |
687 } | 687 } |
688 } | 688 } |
689 | 689 |
690 void TemplateURL::InvalidateCachedValues() { | 690 void TemplateURL::InvalidateCachedValues() { |
691 url_ref_.InvalidateCachedValues(); | 691 url_ref_.InvalidateCachedValues(); |
692 suggestions_url_ref_.InvalidateCachedValues(); | 692 suggestions_url_ref_.InvalidateCachedValues(); |
693 instant_url_ref_.InvalidateCachedValues(); | 693 instant_url_ref_.InvalidateCachedValues(); |
694 ResetKeywordIfNecessary(false); | 694 ResetKeywordIfNecessary(false); |
695 } | 695 } |
OLD | NEW |