summaryrefslogtreecommitdiffstats
path: root/chrome/browser/android
diff options
context:
space:
mode:
authorblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 00:14:49 +0000
committerblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 00:14:49 +0000
commit147420bd02437c4f4424b12606dcd83612b546f0 (patch)
tree2a76b98484d17eab9614a47b4c037f978110557e /chrome/browser/android
parent97538a1abd5e3988c9acefd0d09b29caeffb0e28 (diff)
downloadchromium_src-147420bd02437c4f4424b12606dcd83612b546f0.zip
chromium_src-147420bd02437c4f4424b12606dcd83612b546f0.tar.gz
chromium_src-147420bd02437c4f4424b12606dcd83612b546f0.tar.bz2
Abstract GoogleURLTracker & google_util Profile dependencies
This CL eliminates GoogleURLTracker and google_util having static functions that take in Profiles as arguments and use the Profile to get at the GoogleURLTracker instance. Specifically, it does the following: - Introduces google_profile_helper, as well as a new GetGoogleHomePageURL(Profile) function that serves the purpose previously being served by GoogleURLTracker::GoogleURL(Profile). - The google_util GetGoogleCountryCode(Profile) and GetGoogleSearchURL(Profile) functions now take in the Google homepage URL to operate on rather than the Profile. - Turns GoogleURLTracker's static RequestServerCheck(Profile) and GoogleURLSearchCommitted(Profile) into instance methods, changing callsites to get the tracker from the factory and call the instance method on the tracker if it is not NULL. GoogleURLTracker still uses the Profile to get the Prefs; this will be changed in a different CL. BUG=373235,373223 TBR=thakis Review URL: https://codereview.chromium.org/303233006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/android')
-rw-r--r--chrome/browser/android/logo_service.cc3
-rw-r--r--chrome/browser/android/tab_android.cc6
2 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/android/logo_service.cc b/chrome/browser/android/logo_service.cc
index 3dea449..ed44ac1 100644
--- a/chrome/browser/android/logo_service.cc
+++ b/chrome/browser/android/logo_service.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/android/logo_service.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/google/google_profile_helper.h"
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/image_decoder.h"
@@ -39,7 +40,7 @@ GURL GetGoogleDoodleURL(Profile* profile) {
GURL base_url(google_util::CommandLineGoogleBaseURL());
if (!base_url.is_valid())
- base_url = GoogleURLTracker::GoogleURL(profile);
+ base_url = google_profile_helper::GetGoogleHomePageURL(profile);
return base_url.ReplaceComponents(replacements);
}
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index d288de9..932fdb8 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/google/google_url_tracker.h"
+#include "chrome/browser/google/google_url_tracker_factory.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/prerender/prerender_contents.h"
@@ -414,7 +415,10 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(JNIEnv* env,
// infobar.
if (google_util::IsGoogleSearchUrl(fixed_url) &&
(page_transition & content::PAGE_TRANSITION_GENERATED)) {
- GoogleURLTracker::GoogleURLSearchCommitted(GetProfile());
+ GoogleURLTracker* tracker =
+ GoogleURLTrackerFactory::GetForProfile(GetProfile());
+ if (tracker)
+ tracker->SearchCommitted();
}
// Record UMA "ShowHistory" here. That way it'll pick up both user