| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bool NetworkList::IsNetworkConnected(NetworkType type, | 42 bool NetworkList::IsNetworkConnected(NetworkType type, |
| 43 const string16& id) const { | 43 const string16& id) const { |
| 44 return IsInNetworkList(connected_networks_, type, id); | 44 return IsInNetworkList(connected_networks_, type, id); |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool NetworkList::IsNetworkConnecting(NetworkType type, | 47 bool NetworkList::IsNetworkConnecting(NetworkType type, |
| 48 const string16& id) const { | 48 const string16& id) const { |
| 49 return IsInNetworkList(connecting_networks_, type, id); | 49 return IsInNetworkList(connecting_networks_, type, id); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void NetworkList::OnNetworkManagerChanged( | 52 void NetworkList::NetworkChanged(chromeos::NetworkLibrary* network_lib) { |
| 53 chromeos::NetworkLibrary* network_lib) { | |
| 54 networks_.clear(); | 53 networks_.clear(); |
| 55 connected_networks_.clear(); | 54 connected_networks_.clear(); |
| 56 connecting_networks_.clear(); | 55 connecting_networks_.clear(); |
| 57 // Index of the last added network item. | 56 // Index of the last added network item. |
| 58 size_t index = 0; | 57 size_t index = 0; |
| 59 if (!network_lib || !CrosLibrary::Get()->EnsureLoaded()) | 58 if (!network_lib || !CrosLibrary::Get()->EnsureLoaded()) |
| 60 return; | 59 return; |
| 61 | 60 |
| 62 bool ethernet_connected = network_lib->ethernet_connected(); | 61 bool ethernet_connected = network_lib->ethernet_connected(); |
| 63 bool ethernet_connecting = network_lib->ethernet_connecting(); | 62 bool ethernet_connecting = network_lib->ethernet_connecting(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 bool connected, | 145 bool connected, |
| 147 bool connecting) { | 146 bool connecting) { |
| 148 if (connected) { | 147 if (connected) { |
| 149 connected_networks_.push_back(index); | 148 connected_networks_.push_back(index); |
| 150 } else if (connecting) { | 149 } else if (connecting) { |
| 151 connecting_networks_.push_back(index); | 150 connecting_networks_.push_back(index); |
| 152 } | 151 } |
| 153 } | 152 } |
| 154 | 153 |
| 155 } // namespace chromeos | 154 } // namespace chromeos |
| OLD | NEW |