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 "app/resource_bundle.h" | 8 #include "app/resource_bundle.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return NULL; | 74 return NULL; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 void NetworkList::NetworkChanged(chromeos::NetworkLibrary* network_lib) { | 78 void NetworkList::NetworkChanged(chromeos::NetworkLibrary* network_lib) { |
79 connected_network_index_ = -1; | 79 connected_network_index_ = -1; |
80 connecting_network_index_ = -1; | 80 connecting_network_index_ = -1; |
81 networks_.clear(); | 81 networks_.clear(); |
82 // Index of the last added network item. | 82 // Index of the last added network item. |
83 int index = 0; | 83 int index = 0; |
84 if (!network_lib || !CrosLibrary::EnsureLoaded()) | 84 if (!network_lib || !CrosLibrary::Get()->EnsureLoaded()) |
85 return; | 85 return; |
86 | 86 |
87 if (network_lib->ethernet_connected() || network_lib->ethernet_connecting()) { | 87 if (network_lib->ethernet_connected() || network_lib->ethernet_connecting()) { |
88 string16 label = l10n_util::GetStringUTF16( | 88 string16 label = l10n_util::GetStringUTF16( |
89 IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); | 89 IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); |
90 networks_.push_back(NetworkItem(NETWORK_ETHERNET, | 90 networks_.push_back(NetworkItem(NETWORK_ETHERNET, |
91 label, | 91 label, |
92 WifiNetwork(), | 92 WifiNetwork(), |
93 CellularNetwork())); | 93 CellularNetwork())); |
94 SetNetworksIndices(index++, | 94 SetNetworksIndices(index++, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return; | 135 return; |
136 | 136 |
137 if (connected) { | 137 if (connected) { |
138 connected_network_index_ = index; | 138 connected_network_index_ = index; |
139 } else if (connecting) { | 139 } else if (connecting) { |
140 connecting_network_index_ = index; | 140 connecting_network_index_ = index; |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 } // namespace chromeos | 144 } // namespace chromeos |
OLD | NEW |