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

Unified Diff: chrome/browser/search_engines/template_url_prepopulate_data.h

Issue 9705021: Clean up TemplateURL prepopulate data: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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: chrome/browser/search_engines/template_url_prepopulate_data.h
===================================================================
--- chrome/browser/search_engines/template_url_prepopulate_data.h (revision 126661)
+++ chrome/browser/search_engines/template_url_prepopulate_data.h (working copy)
@@ -10,6 +10,9 @@
#include <string>
#include <vector>
+#include "base/string16.h"
+#include "chrome/browser/search_engines/search_engine_type.h"
+
class GURL;
class PrefService;
class TemplateURL;
@@ -35,19 +38,23 @@
// Returns the default search provider specified by the prepopulate data.
// The caller owns the returned value, which may be NULL.
-// If |prefs| is NULL, search provider overrides from preferences are not used.
+// If |prefs| is NULL, any search provider overrides from the preferences are
+// not used.
TemplateURL* GetPrepopulatedDefaultSearch(PrefService* prefs);
-// Returns a TemplateURL from the prepopulated data which has the same origin
-// as the given url. The caller is responsible for deleting the returned
-// TemplateURL.
-TemplateURL* GetEngineForOrigin(PrefService* prefs, const GURL& url_to_find);
+// Both the next two functions use same-origin checks unless the |url| is a
+// Google seach URL, in which case we'll identify any valid Google hostname, or
+// the unsubstituted Google prepopulate URL, as "Google".
-// Returns the prepopulated search provider whose search URL origin matches the
-// origin of |search_url| or NULL if none is found. The caller is responsible
-// for deleting the returned TemplateURL.
-TemplateURL* FindPrepopulatedEngine(const std::string& search_url);
+// Returns the short name for the matching engine, or url.host() if no engines
+// match. If no engines match and the |url| can't be converted to a valid GURL,
+// returns the string in IDS_UNKNOWN_SEARCH_ENGINE_NAME.
+string16 GetEngineName(const std::string& url);
+// Returns the type of the matching engine, or SEARCH_ENGINE_OTHER if no engines
+// match.
+SearchEngineType GetEngineType(const std::string& url);
+
} // namespace TemplateURLPrepopulateData
#endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_PREPOPULATE_DATA_H_
« no previous file with comments | « chrome/browser/protector/histograms.cc ('k') | chrome/browser/search_engines/template_url_prepopulate_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698