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

Unified Diff: components/search_engines/template_url_prepopulate_data.h

Issue 1983773002: Cache SearchEngineType of TemplateURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-extracting-terms-from-template-url
Patch Set: Fix typo Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/search_engines/template_url_prepopulate_data.h
diff --git a/components/search_engines/template_url_prepopulate_data.h b/components/search_engines/template_url_prepopulate_data.h
index 9d6787305b98f5014824974bbadff162755d5574..a3224f33adb21f5bdf91e9cfb54279b23e6863cf 100644
--- a/components/search_engines/template_url_prepopulate_data.h
+++ b/components/search_engines/template_url_prepopulate_data.h
@@ -17,8 +17,6 @@
class GURL;
class PrefService;
-class SearchTermsData;
-class TemplateURL;
struct TemplateURLData;
namespace user_prefs {
@@ -45,6 +43,9 @@ ScopedVector<TemplateURLData> GetPrepopulatedEngines(
PrefService* prefs,
size_t* default_search_provider_index);
+// Returns all prepopulated engines for all locales. Used only by tests.
+std::vector<const PrepopulatedEngine*> GetAllPrepopulatedEngines();
+
// Returns a TemplateURLData for the specified prepopulated engine.
std::unique_ptr<TemplateURLData> MakeTemplateURLDataFromPrepopulatedEngine(
const PrepopulatedEngine& engine);
@@ -59,15 +60,6 @@ void ClearPrepopulatedEnginesInPrefs(PrefService* prefs);
std::unique_ptr<TemplateURLData> GetPrepopulatedDefaultSearch(
PrefService* prefs);
-// Returns the type of the provided engine, or SEARCH_ENGINE_OTHER if no engines
-// match. This checks the TLD+1 for the most part, but will report the type as
-// SEARCH_ENGINE_GOOGLE for any hostname that causes
-// google_util::IsGoogleHostname() to return true.
-//
-// NOTE: Must be called on the UI thread.
-SearchEngineType GetEngineType(const TemplateURL& template_url,
- const SearchTermsData& search_terms_data);
-
// Like the above, but takes a GURL which is expected to represent a search URL.
// This may be called on any thread.
SearchEngineType GetEngineType(const GURL& url);

Powered by Google App Engine
This is Rietveld 408576698