blob: 8e0d651f799612e7daacae3a7f69b8d338d09964 [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:
14 return blink::ConnectionTypeOther;
15 case net::NetworkChangeNotifier::CONNECTION_ETHERNET:
16 return blink::ConnectionTypeEthernet;
17 case net::NetworkChangeNotifier::CONNECTION_WIFI:
18 return blink::ConnectionTypeWifi;
19 case net::NetworkChangeNotifier::CONNECTION_NONE:
20 return blink::ConnectionTypeNone;
21 case net::NetworkChangeNotifier::CONNECTION_2G:
22 case net::NetworkChangeNotifier::CONNECTION_3G:
23 case net::NetworkChangeNotifier::CONNECTION_4G:
24 return blink::ConnectionTypeCellular;
25 }
26
27 NOTREACHED();
28 return blink::ConnectionTypeNone;
29}
30
31} // namespace content