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

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: Move calculation to TemplateURLData 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..d5626fa1f7f75f3ac5a6af0f2c68043850c7de2e 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 {
@@ -49,6 +47,10 @@ ScopedVector<TemplateURLData> GetPrepopulatedEngines(
std::unique_ptr<TemplateURLData> MakeTemplateURLDataFromPrepopulatedEngine(
const PrepopulatedEngine& engine);
+// Returns a list of all the engines that we know about.
+// This is a big list; it's recommended to use it for testing purposes only.
+std::vector<const PrepopulatedEngine*> GetAllKnownPrepopulatedEngines();
Peter Kasting 2016/06/09 23:00:56 Nit: I would place this right under GetPrepopulate
Vitaly Baranov 2016/06/12 07:29:15 Done.
+
// Removes prepopulated engines and their version stored in user prefs.
void ClearPrepopulatedEnginesInPrefs(PrefService* prefs);
@@ -59,15 +61,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