Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: chrome/browser/chromeos/login/network_screen.cc

Issue 2010001: Refactor WifiNetwork, CellularNetwork, and EthernetNetwork into classes to ma... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 //////////////////////////////////////////////////////////////////////////////// 141 ////////////////////////////////////////////////////////////////////////////////
142 // NetworkScreen, private: 142 // NetworkScreen, private:
143 143
144 void NetworkScreen::ConnectToNetwork(NetworkList::NetworkType type, 144 void NetworkScreen::ConnectToNetwork(NetworkList::NetworkType type,
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, 155 ConnectToWifiNetwork(network->wifi_network,
156 string16(), string16(), string16()); 156 string16(), string16(), string16());
157 } 157 }
158 } else if (NetworkList::NETWORK_CELLULAR == network->network_type) { 158 } else if (NetworkList::NETWORK_CELLULAR == network->network_type) {
159 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> 159 chromeos::CrosLibrary::Get()->GetNetworkLibrary()->
160 ConnectToCellularNetwork(network->cellular_network); 160 ConnectToCellularNetwork(network->cellular_network);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 const string16& id) { 214 const string16& id) {
215 int index = networks_.GetNetworkIndexById(type, id); 215 int index = networks_.GetNetworkIndexById(type, id);
216 if (index >= 0) { 216 if (index >= 0) {
217 view()->SetSelectedNetworkItem(index + 1); 217 view()->SetSelectedNetworkItem(index + 1);
218 } else { 218 } else {
219 view()->SetSelectedNetworkItem(0); 219 view()->SetSelectedNetworkItem(0);
220 } 220 }
221 } 221 }
222 222
223 } // namespace chromeos 223 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_library.cc ('k') | chrome/browser/chromeos/login/network_screen_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698