| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 technologies_found.insert(onc_type); | 581 technologies_found.insert(onc_type); |
| 582 } | 582 } |
| 583 | 583 |
| 584 // For any technologies that we do not have a DeviceState entry for, append | 584 // For any technologies that we do not have a DeviceState entry for, append |
| 585 // an entry if the technolog is available. | 585 // an entry if the technolog is available. |
| 586 const char* technology_types[] = {::onc::network_type::kEthernet, | 586 const char* technology_types[] = {::onc::network_type::kEthernet, |
| 587 ::onc::network_type::kWiFi, | 587 ::onc::network_type::kWiFi, |
| 588 ::onc::network_type::kWimax, | 588 ::onc::network_type::kWimax, |
| 589 ::onc::network_type::kCellular}; | 589 ::onc::network_type::kCellular}; |
| 590 for (const char* technology : technology_types) { | 590 for (const char* technology : technology_types) { |
| 591 if (ContainsValue(technologies_found, technology)) | 591 if (base::ContainsValue(technologies_found, technology)) |
| 592 continue; | 592 continue; |
| 593 AppendDeviceState(technology, nullptr /* device */, | 593 AppendDeviceState(technology, nullptr /* device */, |
| 594 device_state_list.get()); | 594 device_state_list.get()); |
| 595 } | 595 } |
| 596 return device_state_list; | 596 return device_state_list; |
| 597 } | 597 } |
| 598 | 598 |
| 599 bool NetworkingPrivateChromeOS::EnableNetworkType(const std::string& type) { | 599 bool NetworkingPrivateChromeOS::EnableNetworkType(const std::string& type) { |
| 600 NetworkTypePattern pattern = | 600 NetworkTypePattern pattern = |
| 601 chromeos::onc::NetworkTypePatternFromOncType(type); | 601 chromeos::onc::NetworkTypePatternFromOncType(type); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 // Eventually the caller (e.g. Settings) should handle any failures and | 665 // Eventually the caller (e.g. Settings) should handle any failures and |
| 666 // show its own configuration UI. crbug.com/380937. | 666 // show its own configuration UI. crbug.com/380937. |
| 667 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { | 667 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { |
| 668 success_callback.Run(); | 668 success_callback.Run(); |
| 669 return; | 669 return; |
| 670 } | 670 } |
| 671 failure_callback.Run(error_name); | 671 failure_callback.Run(error_name); |
| 672 } | 672 } |
| 673 | 673 |
| 674 } // namespace extensions | 674 } // namespace extensions |
| OLD | NEW |