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

Unified Diff: chrome/browser/chromeos/net/network_change_notifier_chromeos.cc

Issue 11360108: Start calculating new combined NetworkChangeNotifier signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address szym's first round of comments Created 8 years, 1 month 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/chromeos/net/network_change_notifier_chromeos.cc
diff --git a/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc b/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc
index 9cdab7be9f7931c639856e393f0a9a898277e9da..c854e1e38d3753ac9b4a58618049ea92a8881afc 100644
--- a/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc
+++ b/chrome/browser/chromeos/net/network_change_notifier_chromeos.cc
@@ -51,7 +51,8 @@ class NetworkChangeNotifierChromeos::DnsConfigServiceChromeos
};
NetworkChangeNotifierChromeos::NetworkChangeNotifierChromeos()
- : has_active_network_(false),
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsChromeos()),
+ has_active_network_(false),
connection_state_(chromeos::STATE_UNKNOWN),
connection_type_(CONNECTION_NONE),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
@@ -335,4 +336,17 @@ NetworkChangeNotifierChromeos::GetNetworkConnectionType(
return net::NetworkChangeNotifier::CONNECTION_UNKNOWN;
}
+// static
+net::NetworkChangeNotifier::NetworkChangeCalculatorParams
+NetworkChangeNotifierChromeos::NetworkChangeCalculatorParamsChromeos() {
+ NetworkChangeCalculatorParams params;
+ // Delay values arrived at by simple experimentation and adjusted so as to
+ // produce a single signal when switching between network connections.
+ params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000);
+ params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000);
+ params.connection_type_offline_delay_ = base::TimeDelta::FromMilliseconds(0);
+ params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(0);
+ return params;
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698