summaryrefslogtreecommitdiffstats
path: root/components/google
diff options
context:
space:
mode:
authorblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 10:54:17 +0000
committerblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-05 10:54:17 +0000
commit4a23327d451274446261b18ded7b7f014176995e (patch)
tree34247c7e463f632cc824012af91105ceff9e0ba1 /components/google
parent446138cd2adee448ae5a23a824a733e333ea040e (diff)
downloadchromium_src-4a23327d451274446261b18ded7b7f014176995e.zip
chromium_src-4a23327d451274446261b18ded7b7f014176995e.tar.gz
chromium_src-4a23327d451274446261b18ded7b7f014176995e.tar.bz2
Eliminate GoogleURLTracker having a Profile ivar
This CL eliminates GoogleURLTracker needing to have a Profile ivar by adding APIs to GoogleURLTrackerClient to get the PrefService and URLRequestContextGetter to use. This CL additionally eliminates GoogleURLTracker's dependence on //chrome-level prefs by moving the kLastKnownGoogleURL and kLastPromptedGoogleURL prefs into the google component. BUG=373222,373239 TBR=thakis Review URL: https://codereview.chromium.org/307113002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/google')
-rw-r--r--components/google/core/browser/google_pref_names.cc20
-rw-r--r--components/google/core/browser/google_pref_names.h17
-rw-r--r--components/google/core/browser/google_url_tracker_client.h12
3 files changed, 49 insertions, 0 deletions
diff --git a/components/google/core/browser/google_pref_names.cc b/components/google/core/browser/google_pref_names.cc
new file mode 100644
index 0000000..81e6749
--- /dev/null
+++ b/components/google/core/browser/google_pref_names.cc
@@ -0,0 +1,20 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/google/core/browser/google_pref_names.h"
+
+namespace prefs {
+
+// String containing the last known Google URL. We re-detect this on startup in
+// most cases, and use it to send traffic to the correct Google host or with the
+// correct Google domain/country code for whatever location the user is in.
+const char kLastKnownGoogleURL[] = "browser.last_known_google_url";
+
+// String containing the last prompted Google URL to the user.
+// If the user is using .x TLD for Google URL and gets prompted about .y TLD
+// for Google URL, and says "no", we should leave the search engine set to .x
+// but not prompt again until the domain changes away from .y.
+const char kLastPromptedGoogleURL[] = "browser.last_prompted_google_url";
+
+} // namespace prefs
diff --git a/components/google/core/browser/google_pref_names.h b/components/google/core/browser/google_pref_names.h
new file mode 100644
index 0000000..2c58dd2
--- /dev/null
+++ b/components/google/core/browser/google_pref_names.h
@@ -0,0 +1,17 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_PREF_NAMES_H_
+#define COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_PREF_NAMES_H_
+
+namespace prefs {
+
+// Alphabetical list of preference names specific to the Google
+// component. Keep alphabetized, and document each in the .cc file.
+extern const char kLastKnownGoogleURL[];
+extern const char kLastPromptedGoogleURL[];
+
+} // namespace prefs
+
+#endif // COMPONENTS_GOOGLE_CORE_BROWSER_GOOGLE_PREF_NAMES_H_
diff --git a/components/google/core/browser/google_url_tracker_client.h b/components/google/core/browser/google_url_tracker_client.h
index 5cc4f98..044a89a 100644
--- a/components/google/core/browser/google_url_tracker_client.h
+++ b/components/google/core/browser/google_url_tracker_client.h
@@ -8,6 +8,11 @@
#include "base/macros.h"
class GoogleURLTracker;
+class PrefService;
+
+namespace net {
+class URLRequestContextGetter;
+}
// Interface by which GoogleURLTracker communicates with its embedder.
class GoogleURLTrackerClient {
@@ -31,6 +36,13 @@ class GoogleURLTrackerClient {
// Returns whether background networking is enabled.
virtual bool IsBackgroundNetworkingEnabled() = 0;
+ // Returns the PrefService that the GoogleURLTracker should use.
+ virtual PrefService* GetPrefs() = 0;
+
+ // Returns the URL request context information that the GoogleURLTracker
+ // should use.
+ virtual net::URLRequestContextGetter* GetRequestContext() = 0;
+
protected:
GoogleURLTracker* google_url_tracker() { return google_url_tracker_; }