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