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

Side by Side Diff: chromeos/network/network_change_notifier_chromeos.cc

Issue 301193002: Support Bluetooth network connection type on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth
Patch Set: Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698