Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / content / renderer / net_info_helper.cc
blob4db66413ece8e4a2704fec742518ea7908bd2439
1 // 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.
5 #include "content/renderer/net_info_helper.h"
7 namespace content {
9 blink::WebConnectionType
10 NetConnectionTypeToWebConnectionType(
11 net::NetworkChangeNotifier::ConnectionType net_type) {
12 switch (net_type) {
13 case net::NetworkChangeNotifier::CONNECTION_UNKNOWN:
14 return blink::WebConnectionTypeUnknown;
15 case net::NetworkChangeNotifier::CONNECTION_ETHERNET:
16 return blink::WebConnectionTypeEthernet;
17 case net::NetworkChangeNotifier::CONNECTION_WIFI:
18 return blink::WebConnectionTypeWifi;
19 case net::NetworkChangeNotifier::CONNECTION_NONE:
20 return blink::WebConnectionTypeNone;
21 case net::NetworkChangeNotifier::CONNECTION_2G:
22 case net::NetworkChangeNotifier::CONNECTION_3G:
23 case net::NetworkChangeNotifier::CONNECTION_4G:
24 return blink::WebConnectionTypeCellular;
25 case net::NetworkChangeNotifier::CONNECTION_BLUETOOTH:
26 return blink::WebConnectionTypeBluetooth;
29 NOTREACHED();
30 return blink::WebConnectionTypeNone;
33 } // namespace content