| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/webui/help/help_utils_chromeos.h" | 5 #include "chrome/browser/ui/webui/help/help_utils_chromeos.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 continue; | 44 continue; |
| 45 } | 45 } |
| 46 if (connection_type == 4) | 46 if (connection_type == 4) |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 // Device policy does not allow updates over cellular, as cellular is not | 49 // Device policy does not allow updates over cellular, as cellular is not |
| 50 // included in allowed connection types for updates. | 50 // included in allowed connection types for updates. |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 base::string16 GetConnectionTypeAsUTF16(const std::string& type) { | 54 base::string16 GetConnectionTypeAsUTF16(const chromeos::NetworkState* network) { |
| 55 const std::string type = |
| 56 network->IsUsingMobileData() ? shill::kTypeCellular : network->type(); |
| 55 if (chromeos::NetworkTypePattern::Ethernet().MatchesType(type)) | 57 if (chromeos::NetworkTypePattern::Ethernet().MatchesType(type)) |
| 56 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_ETHERNET); | 58 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_ETHERNET); |
| 57 if (type == shill::kTypeWifi) | 59 if (type == shill::kTypeWifi) |
| 58 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIFI); | 60 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIFI); |
| 59 if (type == shill::kTypeWimax) | 61 if (type == shill::kTypeWimax) |
| 60 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIMAX); | 62 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_WIMAX); |
| 61 if (type == shill::kTypeBluetooth) | 63 if (type == shill::kTypeBluetooth) |
| 62 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH); | 64 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_BLUETOOTH); |
| 63 if (type == shill::kTypeCellular) | 65 if (type == shill::kTypeCellular) |
| 64 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR); | 66 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_CELLULAR); |
| 65 if (type == shill::kTypeVPN) | 67 if (type == shill::kTypeVPN) |
| 66 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN); | 68 return l10n_util::GetStringUTF16(IDS_NETWORK_TYPE_VPN); |
| 67 NOTREACHED(); | 69 NOTREACHED(); |
| 68 return base::string16(); | 70 return base::string16(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 } // namespace help_utils_chromeos | 73 } // namespace help_utils_chromeos |
| OLD | NEW |