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

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

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
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 b935e2b9d252a96f5896dbcda8c124e1342bc486..e2b064a57db127a1fbf9c94cad9a3a7de75371ce 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -43,7 +43,7 @@ GoogleURLTracker::GoogleURLTracker(Profile* profile, Mode mode)
need_to_fetch_(false),
need_to_prompt_(false),
search_committed_(false) {
- net::NetworkChangeNotifier::AddIPAddressObserver(this);
+ net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
// Because this function can be called during startup, when kicking off a URL
// fetch can eat up 20 ms of time, we delay five seconds, which is hopefully
@@ -244,16 +244,19 @@ void GoogleURLTracker::Observe(int type,
}
}
-void GoogleURLTracker::OnIPAddressChanged() {
- already_fetched_ = false;
- StartFetchIfDesirable();
+void GoogleURLTracker::OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) {
+ if (type != net::NetworkChangeNotifier::CONNECTION_NONE) {
+ already_fetched_ = false;
+ StartFetchIfDesirable();
+ }
}
void GoogleURLTracker::Shutdown() {
registrar_.RemoveAll();
weak_ptr_factory_.InvalidateWeakPtrs();
fetcher_.reset();
- net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
+ net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void GoogleURLTracker::DeleteMapEntryForService(

Powered by Google App Engine
This is Rietveld 408576698