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

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

Issue 303233006: Abstract GoogleURLTracker & google_util Profile dependencies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments 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
Index: chrome/browser/google/google_url_tracker.cc
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index 49835606c7c18ed87a0e3877875461ff3fc6cedd..092b4124112c06b4793bd5a1911f4464336b50bc 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -77,29 +77,28 @@ GoogleURLTracker::~GoogleURLTracker() {
}
// static
-GURL GoogleURLTracker::GoogleURL(Profile* profile) {
- const GoogleURLTracker* tracker =
- GoogleURLTrackerFactory::GetForProfile(profile);
- return tracker ? tracker->google_url_ : GURL(kDefaultGoogleHomepage);
+GURL GoogleURLTracker::DefaultGoogleHomepage() {
+ return GURL(kDefaultGoogleHomepage);
}
-// static
-void GoogleURLTracker::RequestServerCheck(Profile* profile, bool force) {
- GoogleURLTracker* tracker = GoogleURLTrackerFactory::GetForProfile(profile);
- // If the tracker already has a fetcher, SetNeedToFetch() is unnecessary, and
- // changing |already_fetched_| is wrong.
- if (tracker && !tracker->fetcher_) {
+void GoogleURLTracker::RequestServerCheck(bool force) {
+ // If this instance already has a fetcher, SetNeedToFetch() is unnecessary,
+ // and changing |already_fetched_| is wrong.
+ if (!fetcher_) {
if (force)
- tracker->already_fetched_ = false;
- tracker->SetNeedToFetch();
+ already_fetched_ = false;
+ SetNeedToFetch();
}
}
-// static
-void GoogleURLTracker::GoogleURLSearchCommitted(Profile* profile) {
- GoogleURLTracker* tracker = GoogleURLTrackerFactory::GetForProfile(profile);
- if (tracker)
- tracker->SearchCommitted();
+void GoogleURLTracker::GoogleURLSearchCommitted() {
+ if (need_to_prompt_) {
+ search_committed_ = true;
+ // These notifications will fire a bit later in the same call chain we're
+ // currently in.
+ if (!client_->IsListeningForNavigationStart())
+ client_->SetListeningForNavigationStart(true);
+ }
}
void GoogleURLTracker::AcceptGoogleURL(bool redo_searches) {
@@ -265,16 +264,6 @@ void GoogleURLTracker::StartFetchIfDesirable() {
fetcher_->Start();
}
-void GoogleURLTracker::SearchCommitted() {
- if (need_to_prompt_) {
- search_committed_ = true;
- // These notifications will fire a bit later in the same call chain we're
- // currently in.
- if (!client_->IsListeningForNavigationStart())
- client_->SetListeningForNavigationStart(true);
- }
-}
-
void GoogleURLTracker::OnNavigationPending(
scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper,
InfoBarService* infobar_service,

Powered by Google App Engine
This is Rietveld 408576698