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

Unified Diff: chrome/browser/search_engines/ui_thread_search_terms_data.cc

Issue 896943002: Use UIThreadSearchTermsData to get the Google base URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 11 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_profile_helper.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/ui_thread_search_terms_data.cc
diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc
index 813aa33d340d47c674493e18797f95f8564d1bdc..067a2863082c369d90123c6f10626f02a0d3aaf7 100644
--- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc
+++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc
@@ -10,7 +10,7 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/google/google_brand.h"
-#include "chrome/browser/google/google_profile_helper.h"
+#include "chrome/browser/google/google_url_tracker_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h"
#include "chrome/browser/search/instant_service_factory.h"
@@ -19,6 +19,7 @@
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
+#include "components/google/core/browser/google_url_tracker.h"
#include "components/google/core/browser/google_util.h"
#include "components/omnibox/omnibox_field_trial.h"
#include "components/search/search.h"
@@ -49,9 +50,14 @@ std::string UIThreadSearchTermsData::GoogleBaseURLValue() const {
GURL base_url(google_util::CommandLineGoogleBaseURL());
if (base_url.is_valid())
return base_url.spec();
- return profile_ ?
- google_profile_helper::GetGoogleHomePageURL(profile_).spec() :
- SearchTermsData::GoogleBaseURLValue();
+
+ if (!profile_)
+ return SearchTermsData::GoogleBaseURLValue();
+
+ const GoogleURLTracker* tracker =
+ GoogleURLTrackerFactory::GetForProfile(profile_);
+ return tracker ?
+ tracker->google_url().spec() : GoogleURLTracker::kDefaultGoogleHomepage;
}
std::string UIThreadSearchTermsData::GetApplicationLocale() const {
« no previous file with comments | « chrome/browser/google/google_profile_helper.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698