OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/i18n/icu_string_conversions.h" | 7 #include "base/i18n/icu_string_conversions.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/search_engines/search_engine_type.h" | 12 #include "chrome/browser/search_engines/search_engine_type.h" |
13 #include "chrome/browser/search_engines/search_terms_data.h" | 13 #include "chrome/browser/search_engines/search_terms_data.h" |
14 #include "chrome/browser/search_engines/template_url_model.h" | 14 #include "chrome/browser/search_engines/template_url_model.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "gfx/favicon_size.h" | |
17 #include "net/base/escape.h" | 16 #include "net/base/escape.h" |
18 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/gfx/favicon_size.h" |
19 | 19 |
20 // The TemplateURLRef has any number of terms that need to be replaced. Each of | 20 // The TemplateURLRef has any number of terms that need to be replaced. Each of |
21 // the terms is enclosed in braces. If the character preceeding the final | 21 // the terms is enclosed in braces. If the character preceeding the final |
22 // brace is a ?, it indicates the term is optional and can be replaced with | 22 // brace is a ?, it indicates the term is optional and can be replaced with |
23 // an empty string. | 23 // an empty string. |
24 static const char kStartParameter = '{'; | 24 static const char kStartParameter = '{'; |
25 static const char kEndParameter = '}'; | 25 static const char kEndParameter = '}'; |
26 static const char kOptional = '?'; | 26 static const char kOptional = '?'; |
27 | 27 |
28 // Known parameters found in the URL. | 28 // Known parameters found in the URL. |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 } | 665 } |
666 | 666 |
667 std::string TemplateURL::GetExtensionId() const { | 667 std::string TemplateURL::GetExtensionId() const { |
668 DCHECK(IsExtensionKeyword()); | 668 DCHECK(IsExtensionKeyword()); |
669 return GURL(url_.url()).host(); | 669 return GURL(url_.url()).host(); |
670 } | 670 } |
671 | 671 |
672 bool TemplateURL::IsExtensionKeyword() const { | 672 bool TemplateURL::IsExtensionKeyword() const { |
673 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); | 673 return GURL(url_.url()).SchemeIs(chrome::kExtensionScheme); |
674 } | 674 } |
OLD | NEW |