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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // static | 196 // static |
197 net::NetworkChangeNotifier::ConnectionType | 197 net::NetworkChangeNotifier::ConnectionType |
198 NetworkChangeNotifierChromeos::ConnectionTypeFromShill( | 198 NetworkChangeNotifierChromeos::ConnectionTypeFromShill( |
199 const std::string& type, const std::string& technology) { | 199 const std::string& type, const std::string& technology) { |
200 if (NetworkTypePattern::Ethernet().MatchesType(type)) | 200 if (NetworkTypePattern::Ethernet().MatchesType(type)) |
201 return CONNECTION_ETHERNET; | 201 return CONNECTION_ETHERNET; |
202 else if (type == shill::kTypeWifi) | 202 else if (type == shill::kTypeWifi) |
203 return CONNECTION_WIFI; | 203 return CONNECTION_WIFI; |
204 else if (type == shill::kTypeWimax) | 204 else if (type == shill::kTypeWimax) |
205 return CONNECTION_4G; | 205 return CONNECTION_4G; |
| 206 else if (type == shill::kTypeBluetooth) |
| 207 return CONNECTION_BLUETOOTH; |
206 | 208 |
207 if (type != shill::kTypeCellular) | 209 if (type != shill::kTypeCellular) |
208 return CONNECTION_UNKNOWN; | 210 return CONNECTION_UNKNOWN; |
209 | 211 |
210 // For cellular types, mapping depends on the technology. | 212 // For cellular types, mapping depends on the technology. |
211 if (technology == shill::kNetworkTechnologyEvdo || | 213 if (technology == shill::kNetworkTechnologyEvdo || |
212 technology == shill::kNetworkTechnologyGsm || | 214 technology == shill::kNetworkTechnologyGsm || |
213 technology == shill::kNetworkTechnologyUmts || | 215 technology == shill::kNetworkTechnologyUmts || |
214 technology == shill::kNetworkTechnologyHspa) { | 216 technology == shill::kNetworkTechnologyHspa) { |
215 return CONNECTION_3G; | 217 return CONNECTION_3G; |
(...skipping 14 matching lines...) Expand all Loading... |
230 // produce a single signal when switching between network connections. | 232 // produce a single signal when switching between network connections. |
231 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000); | 233 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000); |
232 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000); | 234 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000); |
233 params.connection_type_offline_delay_ = | 235 params.connection_type_offline_delay_ = |
234 base::TimeDelta::FromMilliseconds(500); | 236 base::TimeDelta::FromMilliseconds(500); |
235 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); | 237 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); |
236 return params; | 238 return params; |
237 } | 239 } |
238 | 240 |
239 } // namespace chromeos | 241 } // namespace chromeos |
OLD | NEW |