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

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

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix instant extended interactive ui test for calling the const version of GetDefaultSearchProvider() 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_SERVICE_H_ 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 // Set the default search provider. |url| may be null. 253 // Set the default search provider. |url| may be null.
254 // This will assert if the default search is managed; the UI should not be 254 // This will assert if the default search is managed; the UI should not be
255 // invoking this method in that situation. 255 // invoking this method in that situation.
256 void SetUserSelectedDefaultSearchProvider(TemplateURL* url); 256 void SetUserSelectedDefaultSearchProvider(TemplateURL* url);
257 257
258 // Returns the default search provider. If the TemplateURLService hasn't been 258 // Returns the default search provider. If the TemplateURLService hasn't been
259 // loaded, the default search provider is pulled from preferences. 259 // loaded, the default search provider is pulled from preferences.
260 // 260 //
261 // NOTE: At least in unittest mode, this may return NULL. 261 // NOTE: At least in unittest mode, this may return NULL.
262 // TODO(blundell): See if all callers can be converted to take in const
263 // pointers and eliminate this version of the method.
264 TemplateURL* GetDefaultSearchProvider();
265 const TemplateURL* GetDefaultSearchProvider() const; 262 const TemplateURL* GetDefaultSearchProvider() const;
266 263
267 // Returns true if the |url| is a search results page from the default search 264 // Returns true if the |url| is a search results page from the default search
268 // provider. 265 // provider.
269 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const; 266 bool IsSearchResultsPageFromDefaultSearchProvider(const GURL& url) const;
270 267
271 // Returns true if the default search is managed through group policy. 268 // Returns true if the default search is managed through group policy.
272 bool is_default_search_managed() const { 269 bool is_default_search_managed() const {
273 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY; 270 return default_search_provider_source_ == DefaultSearchManager::FROM_POLICY;
274 } 271 }
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 // Helper class to manage the default search engine. 846 // Helper class to manage the default search engine.
850 DefaultSearchManager default_search_manager_; 847 DefaultSearchManager default_search_manager_;
851 848
852 std::unique_ptr<GoogleURLTracker::Subscription> 849 std::unique_ptr<GoogleURLTracker::Subscription>
853 google_url_updated_subscription_; 850 google_url_updated_subscription_;
854 851
855 DISALLOW_COPY_AND_ASSIGN(TemplateURLService); 852 DISALLOW_COPY_AND_ASSIGN(TemplateURLService);
856 }; 853 };
857 854
858 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_ 855 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698