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

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

Issue 23712002: Cleanup network type matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit tests and rebased. Created 7 years, 3 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 | Annotate | Revision Log
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 connection_type_ = new_connection_type; 189 connection_type_ = new_connection_type;
190 service_path_ = default_network->path(); 190 service_path_ = default_network->path();
191 ip_address_ = default_network->ip_address(); 191 ip_address_ = default_network->ip_address();
192 dns_servers_ = default_network->dns_servers(); 192 dns_servers_ = default_network->dns_servers();
193 } 193 }
194 194
195 // static 195 // static
196 net::NetworkChangeNotifier::ConnectionType 196 net::NetworkChangeNotifier::ConnectionType
197 NetworkChangeNotifierChromeos::ConnectionTypeFromShill( 197 NetworkChangeNotifierChromeos::ConnectionTypeFromShill(
198 const std::string& type, const std::string& technology) { 198 const std::string& type, const std::string& technology) {
199 if (type == flimflam::kTypeEthernet) 199 if (type == flimflam::kTypeEthernet || type == shill::kTypeEthernetEap)
stevenjb 2013/09/04 20:40:39 We should probably use MatchType here, just to kee
pneubeck (no reviews) 2013/09/05 08:28:34 Done.
200 return CONNECTION_ETHERNET; 200 return CONNECTION_ETHERNET;
201 else if (type == flimflam::kTypeWifi) 201 else if (type == flimflam::kTypeWifi)
202 return CONNECTION_WIFI; 202 return CONNECTION_WIFI;
203 else if (type == flimflam::kTypeWimax) 203 else if (type == flimflam::kTypeWimax)
204 return CONNECTION_4G; 204 return CONNECTION_4G;
205 205
206 if (type != flimflam::kTypeCellular) 206 if (type != flimflam::kTypeCellular)
207 return CONNECTION_UNKNOWN; 207 return CONNECTION_UNKNOWN;
208 208
209 // For cellular types, mapping depends on the technology. 209 // For cellular types, mapping depends on the technology.
(...skipping 19 matching lines...) Expand all
229 // produce a single signal when switching between network connections. 229 // produce a single signal when switching between network connections.
230 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000); 230 params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(4000);
231 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000); 231 params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1000);
232 params.connection_type_offline_delay_ = 232 params.connection_type_offline_delay_ =
233 base::TimeDelta::FromMilliseconds(500); 233 base::TimeDelta::FromMilliseconds(500);
234 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); 234 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500);
235 return params; 235 return params;
236 } 236 }
237 237
238 } // namespace chromeos 238 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698