Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: components/search_engines/template_url.h

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « components/omnibox/browser/history_url_provider.cc ('k') | components/search_engines/template_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698