| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/network_list.h" | 5 #include "chrome/browser/chromeos/network_list.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 // TODO(nkostylev): Show public WiFi networks first. | 73 // TODO(nkostylev): Show public WiFi networks first. |
| 74 WifiNetworkVector wifi = network_lib->wifi_networks(); | 74 WifiNetworkVector wifi = network_lib->wifi_networks(); |
| 75 for (WifiNetworkVector::const_iterator it = wifi.begin(); | 75 for (WifiNetworkVector::const_iterator it = wifi.begin(); |
| 76 it != wifi.end(); ++it, ++index) { | 76 it != wifi.end(); ++it, ++index) { |
| 77 networks_.push_back(NetworkItem(NETWORK_WIFI, | 77 networks_.push_back(NetworkItem(NETWORK_WIFI, |
| 78 ASCIIToUTF16(it->name()), | 78 ASCIIToUTF16(it->name()), |
| 79 *it, | 79 *it, |
| 80 CellularNetwork())); | 80 CellularNetwork())); |
| 81 if (network_lib->wifi_name() == it->name()) { | 81 if (network_lib->wifi_network().service_path() == it->service_path()) { |
| 82 AddNetworkIndexToList(index, | 82 AddNetworkIndexToList(index, |
| 83 network_lib->wifi_connected(), | 83 network_lib->wifi_connected(), |
| 84 network_lib->wifi_connecting()); | 84 network_lib->wifi_connecting()); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 CellularNetworkVector cellular = network_lib->cellular_networks(); | 88 CellularNetworkVector cellular = network_lib->cellular_networks(); |
| 89 for (CellularNetworkVector::const_iterator it = cellular.begin(); | 89 for (CellularNetworkVector::const_iterator it = cellular.begin(); |
| 90 it != cellular.end(); ++it, ++index) { | 90 it != cellular.end(); ++it, ++index) { |
| 91 networks_.push_back(NetworkItem(NETWORK_CELLULAR, | 91 networks_.push_back(NetworkItem(NETWORK_CELLULAR, |
| 92 ASCIIToUTF16(it->name()), | 92 ASCIIToUTF16(it->name()), |
| 93 WifiNetwork(), | 93 WifiNetwork(), |
| 94 *it)); | 94 *it)); |
| 95 if (network_lib->cellular_name() == it->name()) { | 95 if (network_lib->cellular_network().service_path() == it->service_path()) { |
| 96 AddNetworkIndexToList(index, | 96 AddNetworkIndexToList(index, |
| 97 network_lib->cellular_connected(), | 97 network_lib->cellular_connected(), |
| 98 network_lib->cellular_connecting()); | 98 network_lib->cellular_connecting()); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 //////////////////////////////////////////////////////////////////////////////// | 103 //////////////////////////////////////////////////////////////////////////////// |
| 104 // NetworkList, private: | 104 // NetworkList, private: |
| 105 | 105 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool connected, | 141 bool connected, |
| 142 bool connecting) { | 142 bool connecting) { |
| 143 if (connected) { | 143 if (connected) { |
| 144 connected_networks_.push_back(index); | 144 connected_networks_.push_back(index); |
| 145 } else if (connecting) { | 145 } else if (connecting) { |
| 146 connecting_networks_.push_back(index); | 146 connecting_networks_.push_back(index); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace chromeos | 150 } // namespace chromeos |
| OLD | NEW |