| 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     const std::string& onc_spec, | 163     const std::string& onc_spec, | 
| 164     const base::Closure& success_callback, | 164     const base::Closure& success_callback, | 
| 165     const base::Closure& error_callback) const { | 165     const base::Closure& error_callback) const { | 
| 166   std::string error; | 166   std::string error; | 
| 167   scoped_ptr<base::Value> root = base::JSONReader::ReadAndReturnError( | 167   scoped_ptr<base::Value> root = base::JSONReader::ReadAndReturnError( | 
| 168       onc_spec, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error); | 168       onc_spec, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error); | 
| 169 | 169 | 
| 170   base::DictionaryValue* toplevel_onc = nullptr; | 170   base::DictionaryValue* toplevel_onc = nullptr; | 
| 171   if (!root || !root->GetAsDictionary(&toplevel_onc)) { | 171   if (!root || !root->GetAsDictionary(&toplevel_onc)) { | 
| 172     LOG(ERROR) << "Invalid JSON Dictionary: " << error; | 172     LOG(ERROR) << "Invalid JSON Dictionary: " << error; | 
|  | 173     error_callback.Run(); | 
| 173     return; | 174     return; | 
| 174   } | 175   } | 
| 175 | 176 | 
| 176   NetworkHandler::Get() | 177   NetworkHandler::Get() | 
| 177       ->managed_network_configuration_handler() | 178       ->managed_network_configuration_handler() | 
| 178       ->CreateConfiguration( | 179       ->CreateConfiguration( | 
| 179           "", *toplevel_onc, | 180           "", *toplevel_onc, | 
| 180           base::Bind(&NetworkStateHelper::OnCreateConfiguration, | 181           base::Bind(&NetworkStateHelper::OnCreateConfiguration, | 
| 181                      base::Unretained(this), success_callback, error_callback), | 182                      base::Unretained(this), success_callback, error_callback), | 
| 182           base::Bind(&NetworkStateHelper::OnCreateOrConnectNetworkFailed, | 183           base::Bind(&NetworkStateHelper::OnCreateOrConnectNetworkFailed, | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 242 | 243 | 
| 243     return signin_partition->GetURLRequestContext(); | 244     return signin_partition->GetURLRequestContext(); | 
| 244   } | 245   } | 
| 245 | 246 | 
| 246   return ProfileHelper::GetSigninProfile()->GetRequestContext(); | 247   return ProfileHelper::GetSigninProfile()->GetRequestContext(); | 
| 247 } | 248 } | 
| 248 | 249 | 
| 249 }  // namespace login | 250 }  // namespace login | 
| 250 | 251 | 
| 251 }  // namespace chromeos | 252 }  // namespace chromeos | 
| OLD | NEW | 
|---|