| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/helper.h" | 5 #include "chrome/browser/chromeos/login/helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 current_onc->GetString( | 163 current_onc->GetString( |
| 164 onc::network_config::WifiProperty(onc::wifi::kSecurity), &security); | 164 onc::network_config::WifiProperty(onc::wifi::kSecurity), &security); |
| 165 if (security != onc::wifi::kSecurityNone) | 165 if (security != onc::wifi::kSecurityNone) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 const std::string hex_ssid = network_state->GetHexSsid(); | 168 const std::string hex_ssid = network_state->GetHexSsid(); |
| 169 | 169 |
| 170 std::unique_ptr<base::DictionaryValue> copied_onc( | 170 std::unique_ptr<base::DictionaryValue> copied_onc( |
| 171 new base::DictionaryValue()); | 171 new base::DictionaryValue()); |
| 172 copied_onc->Set(onc::toplevel_config::kType, | 172 copied_onc->Set(onc::toplevel_config::kType, |
| 173 new base::StringValue(onc::network_type::kWiFi)); | 173 new base::Value(onc::network_type::kWiFi)); |
| 174 copied_onc->Set(onc::network_config::WifiProperty(onc::wifi::kHexSSID), | 174 copied_onc->Set(onc::network_config::WifiProperty(onc::wifi::kHexSSID), |
| 175 new base::StringValue(hex_ssid)); | 175 new base::Value(hex_ssid)); |
| 176 copied_onc->Set(onc::network_config::WifiProperty(onc::wifi::kSecurity), | 176 copied_onc->Set(onc::network_config::WifiProperty(onc::wifi::kSecurity), |
| 177 new base::StringValue(security)); | 177 new base::Value(security)); |
| 178 base::JSONWriter::Write(*copied_onc.get(), out_onc_spec); | 178 base::JSONWriter::Write(*copied_onc.get(), out_onc_spec); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void NetworkStateHelper::CreateAndConnectNetworkFromOnc( | 181 void NetworkStateHelper::CreateAndConnectNetworkFromOnc( |
| 182 const std::string& onc_spec, | 182 const std::string& onc_spec, |
| 183 const base::Closure& success_callback, | 183 const base::Closure& success_callback, |
| 184 const base::Closure& error_callback) const { | 184 const base::Closure& error_callback) const { |
| 185 std::string error; | 185 std::string error; |
| 186 std::unique_ptr<base::Value> root = base::JSONReader::ReadAndReturnError( | 186 std::unique_ptr<base::Value> root = base::JSONReader::ReadAndReturnError( |
| 187 onc_spec, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error); | 187 onc_spec, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const OnPipeReadyCallback& callback) { | 266 const OnPipeReadyCallback& callback) { |
| 267 base::PostTaskWithTraitsAndReplyWithResult( | 267 base::PostTaskWithTraitsAndReplyWithResult( |
| 268 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 268 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( |
| 269 base::TaskPriority::BACKGROUND), | 269 base::TaskPriority::BACKGROUND), |
| 270 base::Bind(&GetDataReadPipe, data), callback); | 270 base::Bind(&GetDataReadPipe, data), callback); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace login | 273 } // namespace login |
| 274 | 274 |
| 275 } // namespace chromeos | 275 } // namespace chromeos |
| OLD | NEW |