OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 UpdateState(default_network, &connection_type_changed, &ip_address_changed, | 123 UpdateState(default_network, &connection_type_changed, &ip_address_changed, |
124 &dns_changed, &max_bandwidth_changed); | 124 &dns_changed, &max_bandwidth_changed); |
125 | 125 |
126 if (connection_type_changed) | 126 if (connection_type_changed) |
127 NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); | 127 NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); |
128 if (ip_address_changed) | 128 if (ip_address_changed) |
129 NetworkChangeNotifier::NotifyObserversOfIPAddressChange(); | 129 NetworkChangeNotifier::NotifyObserversOfIPAddressChange(); |
130 if (dns_changed) | 130 if (dns_changed) |
131 dns_config_service_->OnNetworkChange(); | 131 dns_config_service_->OnNetworkChange(); |
132 if (max_bandwidth_changed) | 132 if (max_bandwidth_changed || connection_type_changed) { |
133 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange( | 133 NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange( |
134 max_bandwidth_mbps_); | 134 connection_type_, max_bandwidth_mbps_); |
| 135 } |
135 } | 136 } |
136 | 137 |
137 void NetworkChangeNotifierChromeos::UpdateState( | 138 void NetworkChangeNotifierChromeos::UpdateState( |
138 const chromeos::NetworkState* default_network, | 139 const chromeos::NetworkState* default_network, |
139 bool* connection_type_changed, | 140 bool* connection_type_changed, |
140 bool* ip_address_changed, | 141 bool* ip_address_changed, |
141 bool* dns_changed, | 142 bool* dns_changed, |
142 bool* max_bandwidth_changed) { | 143 bool* max_bandwidth_changed) { |
143 *connection_type_changed = false; | 144 *connection_type_changed = false; |
144 *ip_address_changed = false; | 145 *ip_address_changed = false; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // produce a single signal when switching between network connections. | 300 // produce a single signal when switching between network connections. |
300 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000); | 301 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000); |
301 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000); | 302 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000); |
302 params.connection_type_offline_delay_ = | 303 params.connection_type_offline_delay_ = |
303 base::TimeDelta::FromMilliseconds(500); | 304 base::TimeDelta::FromMilliseconds(500); |
304 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); | 305 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); |
305 return params; | 306 return params; |
306 } | 307 } |
307 | 308 |
308 } // namespace chromeos | 309 } // namespace chromeos |
OLD | NEW |