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

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: 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_url_tracker.h ('k') | chrome/browser/google/google_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 986f471fad20624a603a3b70ccafd19858ab4f64..13145cca4b369af0352987c76cd280e6fd7a7fe4 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -73,30 +73,24 @@ GoogleURLTracker::~GoogleURLTracker() {
DCHECK(entry_map_.empty());
}
-// static
-GURL GoogleURLTracker::GoogleURL(Profile* profile) {
- const GoogleURLTracker* tracker =
- GoogleURLTrackerFactory::GetForProfile(profile);
- return tracker ? tracker->google_url_ : 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::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::AcceptGoogleURL(bool redo_searches) {
@@ -261,16 +255,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,
infobars::InfoBarManager* infobar_manager,
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/google/google_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698