| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "extensions/browser/api/networking_private/networking_private_chromeos.
h" | 5 #include "extensions/browser/api/networking_private/networking_private_chromeos.
h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 bool visible_only, | 505 bool visible_only, |
| 506 int limit, | 506 int limit, |
| 507 const NetworkListCallback& success_callback, | 507 const NetworkListCallback& success_callback, |
| 508 const FailureCallback& failure_callback) { | 508 const FailureCallback& failure_callback) { |
| 509 NetworkTypePattern pattern = | 509 NetworkTypePattern pattern = |
| 510 chromeos::onc::NetworkTypePatternFromOncType(network_type); | 510 chromeos::onc::NetworkTypePatternFromOncType(network_type); |
| 511 std::unique_ptr<base::ListValue> network_properties_list = | 511 std::unique_ptr<base::ListValue> network_properties_list = |
| 512 chromeos::network_util::TranslateNetworkListToONC( | 512 chromeos::network_util::TranslateNetworkListToONC( |
| 513 pattern, configured_only, visible_only, limit); | 513 pattern, configured_only, visible_only, limit); |
| 514 | 514 |
| 515 for (auto& value : *network_properties_list) { | 515 for (const auto& value : *network_properties_list) { |
| 516 base::DictionaryValue* network_dict = nullptr; | 516 base::DictionaryValue* network_dict = nullptr; |
| 517 value.GetAsDictionary(&network_dict); | 517 value->GetAsDictionary(&network_dict); |
| 518 DCHECK(network_dict); | 518 DCHECK(network_dict); |
| 519 if (GetThirdPartyVPNDictionary(network_dict)) | 519 if (GetThirdPartyVPNDictionary(network_dict)) |
| 520 AppendThirdPartyProviderName(network_dict); | 520 AppendThirdPartyProviderName(network_dict); |
| 521 } | 521 } |
| 522 | 522 |
| 523 success_callback.Run(std::move(network_properties_list)); | 523 success_callback.Run(std::move(network_properties_list)); |
| 524 } | 524 } |
| 525 | 525 |
| 526 void NetworkingPrivateChromeOS::StartConnect( | 526 void NetworkingPrivateChromeOS::StartConnect( |
| 527 const std::string& guid, | 527 const std::string& guid, |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 // Eventually the caller (e.g. Settings) should handle any failures and | 894 // Eventually the caller (e.g. Settings) should handle any failures and |
| 895 // show its own configuration UI. crbug.com/380937. | 895 // show its own configuration UI. crbug.com/380937. |
| 896 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { | 896 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { |
| 897 success_callback.Run(); | 897 success_callback.Run(); |
| 898 return; | 898 return; |
| 899 } | 899 } |
| 900 failure_callback.Run(error_name); | 900 failure_callback.Run(error_name); |
| 901 } | 901 } |
| 902 | 902 |
| 903 } // namespace extensions | 903 } // namespace extensions |
| OLD | NEW |