| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/system_network/system_network_api.h" | 5 #include "extensions/browser/api/system_network/system_network_api.h" |
| 6 | 6 |
| 7 namespace { | 7 namespace { |
| 8 const char kNetworkListError[] = "Network lookup failed or unsupported"; | 8 const char kNetworkListError[] = "Network lookup failed or unsupported"; |
| 9 } // namespace | 9 } // namespace |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 std::vector<linked_ptr<core_api::system_network::NetworkInterface> > | 63 std::vector<linked_ptr<core_api::system_network::NetworkInterface> > |
| 64 create_arg; | 64 create_arg; |
| 65 create_arg.reserve(interface_list.size()); | 65 create_arg.reserve(interface_list.size()); |
| 66 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); | 66 for (net::NetworkInterfaceList::const_iterator i = interface_list.begin(); |
| 67 i != interface_list.end(); | 67 i != interface_list.end(); |
| 68 ++i) { | 68 ++i) { |
| 69 linked_ptr<core_api::system_network::NetworkInterface> info = | 69 linked_ptr<core_api::system_network::NetworkInterface> info = |
| 70 make_linked_ptr(new core_api::system_network::NetworkInterface); | 70 make_linked_ptr(new core_api::system_network::NetworkInterface); |
| 71 info->name = i->name; | 71 info->name = i->name; |
| 72 info->address = net::IPAddressToString(i->address); | 72 info->address = net::IPAddressToString(i->address); |
| 73 info->prefix_length = i->network_prefix; | 73 info->prefix_length = i->prefix_length; |
| 74 create_arg.push_back(info); | 74 create_arg.push_back(info); |
| 75 } | 75 } |
| 76 | 76 |
| 77 results_ = core_api::system_network::GetNetworkInterfaces::Results::Create( | 77 results_ = core_api::system_network::GetNetworkInterfaces::Results::Create( |
| 78 create_arg); | 78 create_arg); |
| 79 SendResponse(true); | 79 SendResponse(true); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace core_api | 82 } // namespace core_api |
| 83 } // namespace extensions | 83 } // namespace extensions |
| OLD | NEW |