blob: 4d26d02f7759d5ddc762699829a372007dd8aa19 [file] [log] [blame]
[email protected]d7ff5fb2014-05-29 19:50:251// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "content/renderer/net_info_helper.h"
6
7namespace content {
8
9blink::WebConnectionType
10NetConnectionTypeToWebConnectionType(
11 net::NetworkChangeNotifier::ConnectionType net_type) {
12 switch (net_type) {
13 case net::NetworkChangeNotifier::CONNECTION_UNKNOWN:
jkarlin3e18bda2015-09-10 23:34:1314 return blink::WebConnectionTypeUnknown;
[email protected]d7ff5fb2014-05-29 19:50:2515 case net::NetworkChangeNotifier::CONNECTION_ETHERNET:
jkarlin3e18bda2015-09-10 23:34:1316 return blink::WebConnectionTypeEthernet;
[email protected]d7ff5fb2014-05-29 19:50:2517 case net::NetworkChangeNotifier::CONNECTION_WIFI:
jkarlin3e18bda2015-09-10 23:34:1318 return blink::WebConnectionTypeWifi;
[email protected]d7ff5fb2014-05-29 19:50:2519 case net::NetworkChangeNotifier::CONNECTION_NONE:
jkarlin3e18bda2015-09-10 23:34:1320 return blink::WebConnectionTypeNone;
[email protected]d7ff5fb2014-05-29 19:50:2521 case net::NetworkChangeNotifier::CONNECTION_2G:
toyoshimcfb26402015-12-18 04:11:3622 return blink::WebConnectionTypeCellular2G;
[email protected]d7ff5fb2014-05-29 19:50:2523 case net::NetworkChangeNotifier::CONNECTION_3G:
toyoshimcfb26402015-12-18 04:11:3624 return blink::WebConnectionTypeCellular3G;
[email protected]d7ff5fb2014-05-29 19:50:2525 case net::NetworkChangeNotifier::CONNECTION_4G:
toyoshimcfb26402015-12-18 04:11:3626 return blink::WebConnectionTypeCellular4G;
[email protected]078cab22014-06-04 14:08:4027 case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH:
jkarlin3e18bda2015-09-10 23:34:1328 return blink::WebConnectionTypeBluetooth;
[email protected]d7ff5fb2014-05-29 19:50:2529 }
30
31 NOTREACHED();
jkarlin3e18bda2015-09-10 23:34:1332 return blink::WebConnectionTypeNone;
[email protected]d7ff5fb2014-05-29 19:50:2533}
34
35} // namespace content