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 "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 const string16& id) { | 145 const string16& id) { |
146 const NetworkList::NetworkItem* network = | 146 const NetworkList::NetworkItem* network = |
147 networks_.GetNetworkById(type, id); | 147 networks_.GetNetworkById(type, id); |
148 if (network && !IsSameNetwork(network, networks_.ConnectedNetwork())) { | 148 if (network && !IsSameNetwork(network, networks_.ConnectedNetwork())) { |
149 if (NetworkList::NETWORK_WIFI == network->network_type) { | 149 if (NetworkList::NETWORK_WIFI == network->network_type) { |
150 if (network->wifi_network.encrypted) { | 150 if (network->wifi_network.encrypted) { |
151 OpenPasswordDialog(network->wifi_network); | 151 OpenPasswordDialog(network->wifi_network); |
152 return; | 152 return; |
153 } else { | 153 } else { |
154 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 154 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
155 ConnectToWifiNetwork(network->wifi_network, string16()); | 155 ConnectToWifiNetwork(network->wifi_network, |
| 156 string16(), string16(), string16()); |
156 } | 157 } |
157 } else if (NetworkList::NETWORK_CELLULAR == network->network_type) { | 158 } else if (NetworkList::NETWORK_CELLULAR == network->network_type) { |
158 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 159 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
159 ConnectToCellularNetwork(network->cellular_network); | 160 ConnectToCellularNetwork(network->cellular_network); |
160 } | 161 } |
161 } | 162 } |
162 // Check if there's already connected network and update screen state. | 163 // Check if there's already connected network and update screen state. |
163 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( | 164 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( |
164 &NetworkScreen::NetworkChanged, | 165 &NetworkScreen::NetworkChanged, |
165 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | 166 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 const string16& id) { | 214 const string16& id) { |
214 int index = networks_.GetNetworkIndexById(type, id); | 215 int index = networks_.GetNetworkIndexById(type, id); |
215 if (index >= 0) { | 216 if (index >= 0) { |
216 view()->SetSelectedNetworkItem(index + 1); | 217 view()->SetSelectedNetworkItem(index + 1); |
217 } else { | 218 } else { |
218 view()->SetSelectedNetworkItem(0); | 219 view()->SetSelectedNetworkItem(0); |
219 } | 220 } |
220 } | 221 } |
221 | 222 |
222 } // namespace chromeos | 223 } // namespace chromeos |
OLD | NEW |