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

Unified Diff: chrome/browser/google/google_util.cc

Issue 303233006: Abstract GoogleURLTracker & google_util Profile dependencies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix and rebase Created 6 years, 7 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
« no previous file with comments | « chrome/browser/google/google_util.h ('k') | chrome/browser/profile_resetter/profile_resetter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_util.cc
diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc
index 6d1b3ce27c9eb2b679849eee58ed90b8ccf4a4bf..3b6f1cbfe53ad4b340b5a659849145515bffd646 100644
--- a/chrome/browser/google/google_util.cc
+++ b/chrome/browser/google/google_util.cc
@@ -95,9 +95,8 @@ std::string StringAppendGoogleLocaleParam(const std::string& url) {
return localized_url.spec();
}
-std::string GetGoogleCountryCode(Profile* profile) {
- const std::string google_hostname =
- GoogleURLTracker::GoogleURL(profile).host();
+std::string GetGoogleCountryCode(GURL google_homepage_url) {
+ const std::string google_hostname = google_homepage_url.host();
const size_t last_dot = google_hostname.find_last_of('.');
if (last_dot == std::string::npos) {
NOTREACHED();
@@ -117,15 +116,15 @@ std::string GetGoogleCountryCode(Profile* profile) {
return country_code;
}
-GURL GetGoogleSearchURL(Profile* profile) {
- // The url returned by the tracker does not include the "/search" or the
- // "q=" query string.
+GURL GetGoogleSearchURL(GURL google_homepage_url) {
+ // To transform the homepage URL into the corresponding search URL, add the
+ // "search" and the "q=" query string.
std::string search_path = "search";
std::string query_string = "q=";
GURL::Replacements replacements;
replacements.SetPathStr(search_path);
replacements.SetQueryStr(query_string);
- return GoogleURLTracker::GoogleURL(profile).ReplaceComponents(replacements);
+ return google_homepage_url.ReplaceComponents(replacements);
}
#if defined(OS_WIN)
« no previous file with comments | « chrome/browser/google/google_util.h ('k') | chrome/browser/profile_resetter/profile_resetter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698