OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/options/chromeos/internet_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 status.append(chromeos::CellularNetwork::ActivationStateToString( | 1044 status.append(chromeos::CellularNetwork::ActivationStateToString( |
1045 activation_state)); | 1045 activation_state)); |
1046 } | 1046 } |
1047 } | 1047 } |
1048 } | 1048 } |
1049 | 1049 |
1050 // To keep the consistency with JS implementation, do not change the order | 1050 // To keep the consistency with JS implementation, do not change the order |
1051 // locally. | 1051 // locally. |
1052 // TODO(kochi): Use dictionaly for future maintainability. | 1052 // TODO(kochi): Use dictionaly for future maintainability. |
1053 // 0) service path | 1053 // 0) service path |
1054 network->Append(Value::CreateStringValue(service_path)); | 1054 network->Append(base::StringValue::New(service_path)); |
1055 // 1) name | 1055 // 1) name |
1056 network->Append(Value::CreateStringValue(name)); | 1056 network->Append(base::StringValue::New(name)); |
1057 // 2) status | 1057 // 2) status |
1058 network->Append(Value::CreateStringValue(status)); | 1058 network->Append(base::StringValue::New(status)); |
1059 // 3) type | 1059 // 3) type |
1060 network->Append(Value::CreateIntegerValue(static_cast<int>(connection_type))); | 1060 network->Append(base::NumberValue::New(static_cast<int>(connection_type))); |
1061 // 4) connected | 1061 // 4) connected |
1062 network->Append(Value::CreateBooleanValue(connected)); | 1062 network->Append(base::BooleanValue::New(connected)); |
1063 // 5) connecting | 1063 // 5) connecting |
1064 network->Append(Value::CreateBooleanValue(connecting)); | 1064 network->Append(base::BooleanValue::New(connecting)); |
1065 // 6) icon data url | 1065 // 6) icon data url |
1066 network->Append(Value::CreateStringValue(icon.isNull() ? "" : | 1066 network->Append(base::StringValue::New(icon.isNull() ? "" : |
1067 web_ui_util::GetImageDataUrl(icon))); | 1067 web_ui_util::GetImageDataUrl(icon))); |
1068 // 7) remembered | 1068 // 7) remembered |
1069 network->Append(Value::CreateBooleanValue(remembered)); | 1069 network->Append(base::BooleanValue::New(remembered)); |
1070 // 8) activation state | 1070 // 8) activation state |
1071 network->Append(Value::CreateIntegerValue( | 1071 network->Append(base::NumberValue::New( |
1072 static_cast<int>(activation_state))); | 1072 static_cast<int>(activation_state))); |
1073 // 9) needs new plan | 1073 // 9) needs new plan |
1074 network->Append(Value::CreateBooleanValue(needs_new_plan)); | 1074 network->Append(base::BooleanValue::New(needs_new_plan)); |
1075 // 10) connectable | 1075 // 10) connectable |
1076 network->Append(Value::CreateBooleanValue(connectable)); | 1076 network->Append(base::BooleanValue::New(connectable)); |
1077 return network; | 1077 return network; |
1078 } | 1078 } |
1079 | 1079 |
1080 ListValue* InternetOptionsHandler::GetWiredList() { | 1080 ListValue* InternetOptionsHandler::GetWiredList() { |
1081 ListValue* list = new ListValue(); | 1081 ListValue* list = new ListValue(); |
1082 | 1082 |
1083 // If ethernet is not enabled, then don't add anything. | 1083 // If ethernet is not enabled, then don't add anything. |
1084 if (cros_->ethernet_enabled()) { | 1084 if (cros_->ethernet_enabled()) { |
1085 const chromeos::EthernetNetwork* ethernet_network = | 1085 const chromeos::EthernetNetwork* ethernet_network = |
1086 cros_->ethernet_network(); | 1086 cros_->ethernet_network(); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); | 1268 dictionary->SetBoolean("accessLocked", cros_->IsLocked()); |
1269 dictionary->Set("wiredList", GetWiredList()); | 1269 dictionary->Set("wiredList", GetWiredList()); |
1270 dictionary->Set("wirelessList", GetWirelessList()); | 1270 dictionary->Set("wirelessList", GetWirelessList()); |
1271 dictionary->Set("vpnList", GetVPNList()); | 1271 dictionary->Set("vpnList", GetVPNList()); |
1272 dictionary->Set("rememberedList", GetRememberedList()); | 1272 dictionary->Set("rememberedList", GetRememberedList()); |
1273 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); | 1273 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); |
1274 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); | 1274 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); |
1275 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); | 1275 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); |
1276 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); | 1276 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); |
1277 } | 1277 } |
OLD | NEW |