OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cros/network_library_impl_stub.h" | 5 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 WifiNetwork* wifi7 = new WifiNetwork("wifi7"); | 172 WifiNetwork* wifi7 = new WifiNetwork("wifi7"); |
173 wifi7->set_name("Fake Wifi7 (policy-managed)"); | 173 wifi7->set_name("Fake Wifi7 (policy-managed)"); |
174 wifi7->set_strength(100); | 174 wifi7->set_strength(100); |
175 wifi7->set_connectable(false); | 175 wifi7->set_connectable(false); |
176 wifi7->set_passphrase_required(true); | 176 wifi7->set_passphrase_required(true); |
177 wifi7->set_encryption(SECURITY_8021X); | 177 wifi7->set_encryption(SECURITY_8021X); |
178 wifi7->SetEAPMethod(EAP_METHOD_PEAP); | 178 wifi7->SetEAPMethod(EAP_METHOD_PEAP); |
179 wifi7->SetEAPIdentity("enterprise@example.com"); | 179 wifi7->SetEAPIdentity("enterprise@example.com"); |
180 wifi7->SetEAPPassphrase("password"); | 180 wifi7->SetEAPPassphrase("password"); |
181 NetworkUIData wifi7_ui_data; | 181 NetworkUIData wifi7_ui_data; |
182 wifi7_ui_data.set_onc_source(NetworkUIData::ONC_SOURCE_DEVICE_POLICY); | 182 wifi7_ui_data.set_onc_source(onc::ONC_SOURCE_DEVICE_POLICY); |
183 wifi7->set_ui_data(wifi7_ui_data); | 183 wifi7->set_ui_data(wifi7_ui_data); |
184 AddStubNetwork(wifi7, PROFILE_USER); | 184 AddStubNetwork(wifi7, PROFILE_USER); |
185 | 185 |
186 CellularNetwork* cellular1 = new CellularNetwork("cellular1"); | 186 CellularNetwork* cellular1 = new CellularNetwork("cellular1"); |
187 cellular1->set_name("Fake Cellular 1"); | 187 cellular1->set_name("Fake Cellular 1"); |
188 cellular1->set_device_path(cellular->device_path()); | 188 cellular1->set_device_path(cellular->device_path()); |
189 cellular1->set_strength(100); | 189 cellular1->set_strength(100); |
190 cellular1->set_connected(); | 190 cellular1->set_connected(); |
191 cellular1->set_activation_state(ACTIVATION_STATE_ACTIVATED); | 191 cellular1->set_activation_state(ACTIVATION_STATE_ACTIVATED); |
192 cellular1->set_payment_url(std::string("http://www.google.com")); | 192 cellular1->set_payment_url(std::string("http://www.google.com")); |
(...skipping 11 matching lines...) Expand all Loading... |
204 cellular2->set_payment_url(std::string("http://www.google.com")); | 204 cellular2->set_payment_url(std::string("http://www.google.com")); |
205 cellular2->set_usage_url(std::string("http://www.google.com")); | 205 cellular2->set_usage_url(std::string("http://www.google.com")); |
206 AddStubNetwork(cellular2, PROFILE_NONE); | 206 AddStubNetwork(cellular2, PROFILE_NONE); |
207 | 207 |
208 CellularNetwork* cellular3 = new CellularNetwork("cellular3"); | 208 CellularNetwork* cellular3 = new CellularNetwork("cellular3"); |
209 cellular3->set_name("Fake Cellular 3 (policy-managed)"); | 209 cellular3->set_name("Fake Cellular 3 (policy-managed)"); |
210 cellular3->set_device_path(cellular->device_path()); | 210 cellular3->set_device_path(cellular->device_path()); |
211 cellular3->set_activation_state(ACTIVATION_STATE_ACTIVATED); | 211 cellular3->set_activation_state(ACTIVATION_STATE_ACTIVATED); |
212 cellular3->set_network_technology(NETWORK_TECHNOLOGY_EVDO); | 212 cellular3->set_network_technology(NETWORK_TECHNOLOGY_EVDO); |
213 NetworkUIData cellular3_ui_data; | 213 NetworkUIData cellular3_ui_data; |
214 cellular3_ui_data.set_onc_source(NetworkUIData::ONC_SOURCE_USER_POLICY); | 214 cellular3_ui_data.set_onc_source(onc::ONC_SOURCE_USER_POLICY); |
215 cellular3->set_ui_data(cellular3_ui_data); | 215 cellular3->set_ui_data(cellular3_ui_data); |
216 AddStubNetwork(cellular3, PROFILE_NONE); | 216 AddStubNetwork(cellular3, PROFILE_NONE); |
217 | 217 |
218 CellularNetwork* cellular4 = new CellularNetwork("cellular4"); | 218 CellularNetwork* cellular4 = new CellularNetwork("cellular4"); |
219 cellular4->set_name("Fake Cellular 4 (policy-managed)"); | 219 cellular4->set_name("Fake Cellular 4 (policy-managed)"); |
220 cellular4->set_device_path(cellular_gsm->device_path()); | 220 cellular4->set_device_path(cellular_gsm->device_path()); |
221 cellular4->set_activation_state(ACTIVATION_STATE_ACTIVATED); | 221 cellular4->set_activation_state(ACTIVATION_STATE_ACTIVATED); |
222 cellular4->set_network_technology(NETWORK_TECHNOLOGY_GSM); | 222 cellular4->set_network_technology(NETWORK_TECHNOLOGY_GSM); |
223 NetworkUIData cellular4_ui_data; | 223 NetworkUIData cellular4_ui_data; |
224 cellular4_ui_data.set_onc_source(NetworkUIData::ONC_SOURCE_USER_POLICY); | 224 cellular4_ui_data.set_onc_source(onc::ONC_SOURCE_USER_POLICY); |
225 cellular4->set_ui_data(cellular4_ui_data); | 225 cellular4->set_ui_data(cellular4_ui_data); |
226 AddStubNetwork(cellular4, PROFILE_NONE); | 226 AddStubNetwork(cellular4, PROFILE_NONE); |
227 | 227 |
228 WimaxNetwork* wimax1 = new WimaxNetwork("wimax1"); | 228 WimaxNetwork* wimax1 = new WimaxNetwork("wimax1"); |
229 wimax1->set_name("Fake WiMAX Protected"); | 229 wimax1->set_name("Fake WiMAX Protected"); |
230 wimax1->set_strength(75); | 230 wimax1->set_strength(75); |
231 wimax1->set_connectable(true); | 231 wimax1->set_connectable(true); |
232 wimax1->set_eap_identity("WiMAX User 1"); | 232 wimax1->set_eap_identity("WiMAX User 1"); |
233 wimax1->set_passphrase_required(true); | 233 wimax1->set_passphrase_required(true); |
234 AddStubNetwork(wimax1, PROFILE_NONE); | 234 AddStubNetwork(wimax1, PROFILE_NONE); |
(...skipping 23 matching lines...) Expand all Loading... |
258 vpn3->set_name("Fake VPN3"); | 258 vpn3->set_name("Fake VPN3"); |
259 vpn3->set_server_hostname("vpn3server.fake.com"); | 259 vpn3->set_server_hostname("vpn3server.fake.com"); |
260 vpn3->set_provider_type(PROVIDER_TYPE_OPEN_VPN); | 260 vpn3->set_provider_type(PROVIDER_TYPE_OPEN_VPN); |
261 AddStubNetwork(vpn3, PROFILE_USER); | 261 AddStubNetwork(vpn3, PROFILE_USER); |
262 | 262 |
263 VirtualNetwork* vpn4 = new VirtualNetwork("vpn4"); | 263 VirtualNetwork* vpn4 = new VirtualNetwork("vpn4"); |
264 vpn4->set_name("Fake VPN4 (policy-managed)"); | 264 vpn4->set_name("Fake VPN4 (policy-managed)"); |
265 vpn4->set_server_hostname("vpn4server.fake.com"); | 265 vpn4->set_server_hostname("vpn4server.fake.com"); |
266 vpn4->set_provider_type(PROVIDER_TYPE_OPEN_VPN); | 266 vpn4->set_provider_type(PROVIDER_TYPE_OPEN_VPN); |
267 NetworkUIData vpn4_ui_data; | 267 NetworkUIData vpn4_ui_data; |
268 vpn4_ui_data.set_onc_source(NetworkUIData::ONC_SOURCE_DEVICE_POLICY); | 268 vpn4_ui_data.set_onc_source(onc::ONC_SOURCE_DEVICE_POLICY); |
269 vpn4->set_ui_data(vpn4_ui_data); | 269 vpn4->set_ui_data(vpn4_ui_data); |
270 AddStubNetwork(vpn4, PROFILE_USER); | 270 AddStubNetwork(vpn4, PROFILE_USER); |
271 | 271 |
272 wifi_scanning_ = false; | 272 wifi_scanning_ = false; |
273 offline_mode_ = false; | 273 offline_mode_ = false; |
274 | 274 |
275 // Ensure our active network is connected and vice versa, otherwise our | 275 // Ensure our active network is connected and vice versa, otherwise our |
276 // autotest browser_tests sometimes conclude the device is offline. | 276 // autotest browser_tests sometimes conclude the device is offline. |
277 CHECK(active_network()->connected()) | 277 CHECK(active_network()->connected()) |
278 << "Active: " << active_network()->name(); | 278 << "Active: " << active_network()->name(); |
(...skipping 15 matching lines...) Expand all Loading... |
294 " \"PSK\": \"chromeos\"," | 294 " \"PSK\": \"chromeos\"," |
295 " }," | 295 " }," |
296 " \"L2TP\": {" | 296 " \"L2TP\": {" |
297 " \"Username\": \"vpntest\"," | 297 " \"Username\": \"vpntest\"," |
298 " }" | 298 " }" |
299 " }" | 299 " }" |
300 " }" | 300 " }" |
301 " ]," | 301 " ]," |
302 " \"Certificates\": []" | 302 " \"Certificates\": []" |
303 "}"); | 303 "}"); |
304 // LoadOncNetworks(test_blob, "", NetworkUIData::ONC_SOURCE_USER_IMPORT, NULL); | 304 // LoadOncNetworks(test_blob, "", onc::ONC_SOURCE_USER_IMPORT, NULL); |
305 } | 305 } |
306 | 306 |
307 bool NetworkLibraryImplStub::IsCros() const { | 307 bool NetworkLibraryImplStub::IsCros() const { |
308 return false; | 308 return false; |
309 } | 309 } |
310 | 310 |
311 //////////////////////////////////////////////////////////////////////////// | 311 //////////////////////////////////////////////////////////////////////////// |
312 // NetworkLibraryImplStub private methods. | 312 // NetworkLibraryImplStub private methods. |
313 | 313 |
314 void NetworkLibraryImplStub::AddStubNetwork( | 314 void NetworkLibraryImplStub::AddStubNetwork( |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 if (network) | 697 if (network) |
698 ip_configs_.push_back(NetworkIPConfig(network->device_path(), | 698 ip_configs_.push_back(NetworkIPConfig(network->device_path(), |
699 IPCONFIG_TYPE_IPV4, | 699 IPCONFIG_TYPE_IPV4, |
700 address, | 700 address, |
701 netmask, | 701 netmask, |
702 gateway, | 702 gateway, |
703 name_servers)); | 703 name_servers)); |
704 } | 704 } |
705 | 705 |
706 } // namespace chromeos | 706 } // namespace chromeos |
OLD | NEW |