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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 bool visible_only, | 440 bool visible_only, |
441 int limit, | 441 int limit, |
442 const NetworkListCallback& success_callback, | 442 const NetworkListCallback& success_callback, |
443 const FailureCallback& failure_callback) { | 443 const FailureCallback& failure_callback) { |
444 NetworkTypePattern pattern = | 444 NetworkTypePattern pattern = |
445 chromeos::onc::NetworkTypePatternFromOncType(network_type); | 445 chromeos::onc::NetworkTypePatternFromOncType(network_type); |
446 std::unique_ptr<base::ListValue> network_properties_list = | 446 std::unique_ptr<base::ListValue> network_properties_list = |
447 chromeos::network_util::TranslateNetworkListToONC( | 447 chromeos::network_util::TranslateNetworkListToONC( |
448 pattern, configured_only, visible_only, limit); | 448 pattern, configured_only, visible_only, limit); |
449 | 449 |
450 for (const auto& value : *network_properties_list) { | 450 for (auto& value : *network_properties_list) { |
451 base::DictionaryValue* network_dict = nullptr; | 451 base::DictionaryValue* network_dict = nullptr; |
452 value->GetAsDictionary(&network_dict); | 452 value.GetAsDictionary(&network_dict); |
453 DCHECK(network_dict); | 453 DCHECK(network_dict); |
454 if (GetThirdPartyVPNDictionary(network_dict)) | 454 if (GetThirdPartyVPNDictionary(network_dict)) |
455 AppendThirdPartyProviderName(network_dict); | 455 AppendThirdPartyProviderName(network_dict); |
456 } | 456 } |
457 | 457 |
458 success_callback.Run(std::move(network_properties_list)); | 458 success_callback.Run(std::move(network_properties_list)); |
459 } | 459 } |
460 | 460 |
461 void NetworkingPrivateChromeOS::StartConnect( | 461 void NetworkingPrivateChromeOS::StartConnect( |
462 const std::string& guid, | 462 const std::string& guid, |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 // Eventually the caller (e.g. Settings) should handle any failures and | 829 // Eventually the caller (e.g. Settings) should handle any failures and |
830 // show its own configuration UI. crbug.com/380937. | 830 // show its own configuration UI. crbug.com/380937. |
831 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { | 831 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { |
832 success_callback.Run(); | 832 success_callback.Run(); |
833 return; | 833 return; |
834 } | 834 } |
835 failure_callback.Run(error_name); | 835 failure_callback.Run(error_name); |
836 } | 836 } |
837 | 837 |
838 } // namespace extensions | 838 } // namespace extensions |
OLD | NEW |