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/login/network_screen.h" | 5 #include "chrome/browser/chromeos/login/network_screen.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 "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 void NetworkScreen::UpdateStatus(NetworkLibrary* network) { | 159 void NetworkScreen::UpdateStatus(NetworkLibrary* network) { |
160 if (!view() || !network) | 160 if (!view() || !network) |
161 return; | 161 return; |
162 | 162 |
163 if (network->ethernet_connected()) { | 163 if (network->ethernet_connected()) { |
164 StopWaitingForConnection( | 164 StopWaitingForConnection( |
165 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); | 165 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); |
166 } else if (network->wifi_connected()) { | 166 } else if (network->wifi_connected()) { |
167 StopWaitingForConnection(ASCIIToUTF16(network->wifi_network().name())); | 167 StopWaitingForConnection(ASCIIToUTF16(network->wifi_network()->name())); |
168 } else if (network->cellular_connected()) { | 168 } else if (network->cellular_connected()) { |
169 StopWaitingForConnection(ASCIIToUTF16(network->cellular_network().name())); | 169 StopWaitingForConnection(ASCIIToUTF16(network->cellular_network()->name())); |
170 } else if (network->ethernet_connecting()) { | 170 } else if (network->ethernet_connecting()) { |
171 WaitForConnection( | 171 WaitForConnection( |
172 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); | 172 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); |
173 } else if (network->wifi_connecting()) { | 173 } else if (network->wifi_connecting()) { |
174 WaitForConnection(ASCIIToUTF16(network->wifi_network().name())); | 174 WaitForConnection(ASCIIToUTF16(network->wifi_network()->name())); |
175 } else if (network->cellular_connecting()) { | 175 } else if (network->cellular_connecting()) { |
176 WaitForConnection(ASCIIToUTF16(network->cellular_network().name())); | 176 WaitForConnection(ASCIIToUTF16(network->cellular_network()->name())); |
177 } else { | 177 } else { |
178 StopWaitingForConnection(network_id_); | 178 StopWaitingForConnection(network_id_); |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 void NetworkScreen::StopWaitingForConnection(const string16& network_id) { | 182 void NetworkScreen::StopWaitingForConnection(const string16& network_id) { |
183 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); | 183 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); |
184 bool is_connected = network && network->Connected(); | 184 bool is_connected = network && network->Connected(); |
185 if (is_connected && continue_pressed_) { | 185 if (is_connected && continue_pressed_) { |
186 NotifyOnConnection(); | 186 NotifyOnConnection(); |
(...skipping 16 matching lines...) Expand all Loading... |
203 &NetworkScreen::OnConnectionTimeout); | 203 &NetworkScreen::OnConnectionTimeout); |
204 } | 204 } |
205 | 205 |
206 network_id_ = network_id; | 206 network_id_ = network_id; |
207 view()->ShowConnectingStatus(continue_pressed_, network_id_); | 207 view()->ShowConnectingStatus(continue_pressed_, network_id_); |
208 | 208 |
209 view()->EnableContinue(false); | 209 view()->EnableContinue(false); |
210 } | 210 } |
211 | 211 |
212 } // namespace chromeos | 212 } // namespace chromeos |
OLD | NEW |