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 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 // Given a |url| corresponding to this TemplateURL, identifies the search | 665 // Given a |url| corresponding to this TemplateURL, identifies the search |
666 // terms and replaces them with the ones in |search_terms_args|, leaving the | 666 // terms and replaces them with the ones in |search_terms_args|, leaving the |
667 // other parameters untouched. If the replacement fails, returns false and | 667 // other parameters untouched. If the replacement fails, returns false and |
668 // leaves |result| untouched. This is used by mobile ports to perform query | 668 // leaves |result| untouched. This is used by mobile ports to perform query |
669 // refinement. | 669 // refinement. |
670 bool ReplaceSearchTermsInURL( | 670 bool ReplaceSearchTermsInURL( |
671 const GURL& url, | 671 const GURL& url, |
672 const TemplateURLRef::SearchTermsArgs& search_terms_args, | 672 const TemplateURLRef::SearchTermsArgs& search_terms_args, |
673 const SearchTermsData& search_terms_data, | 673 const SearchTermsData& search_terms_data, |
674 GURL* result); | 674 GURL* result) const; |
675 | 675 |
676 // Encodes the search terms from |search_terms_args| so that we know the | 676 // Encodes the search terms from |search_terms_args| so that we know the |
677 // |input_encoding|. Returns the |encoded_terms| and the | 677 // |input_encoding|. Returns the |encoded_terms| and the |
678 // |encoded_original_query|. |encoded_terms| may be escaped as path or query | 678 // |encoded_original_query|. |encoded_terms| may be escaped as path or query |
679 // depending on |is_in_query|; |encoded_original_query| is always escaped as | 679 // depending on |is_in_query|; |encoded_original_query| is always escaped as |
680 // query. | 680 // query. |
681 void EncodeSearchTerms( | 681 void EncodeSearchTerms( |
682 const TemplateURLRef::SearchTermsArgs& search_terms_args, | 682 const TemplateURLRef::SearchTermsArgs& search_terms_args, |
683 bool is_in_query, | 683 bool is_in_query, |
684 std::string* input_encoding, | 684 std::string* input_encoding, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 | 744 |
745 // Caches the computed engine type across successive calls to GetEngineType(). | 745 // Caches the computed engine type across successive calls to GetEngineType(). |
746 mutable SearchEngineType engine_type_; | 746 mutable SearchEngineType engine_type_; |
747 | 747 |
748 // TODO(sky): Add date last parsed OSD file. | 748 // TODO(sky): Add date last parsed OSD file. |
749 | 749 |
750 DISALLOW_COPY_AND_ASSIGN(TemplateURL); | 750 DISALLOW_COPY_AND_ASSIGN(TemplateURL); |
751 }; | 751 }; |
752 | 752 |
753 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ | 753 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_H_ |
OLD | NEW |