| 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 "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "chrome/browser/chromeos/cros/native_network_constants.h" | 10 #include "chrome/browser/chromeos/cros/native_network_constants.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chromeos/chromeos_switches.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "third_party/cros_system_api/dbus/service_constants.h" | 13 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 14 | 14 |
| 15 using content::BrowserThread; | 15 using content::BrowserThread; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 bool IsEthernetEnabled() { | 19 bool IsEthernetEnabled() { |
| 20 return !CommandLine::ForCurrentProcess()->HasSwitch( | 20 return !CommandLine::ForCurrentProcess()->HasSwitch( |
| 21 switches::kDisableStubEthernet); | 21 chromeos::switches::kDisableStubEthernet); |
| 22 } | 22 } |
| 23 | 23 |
| 24 bool IsInteractive() { | 24 bool IsInteractive() { |
| 25 return CommandLine::ForCurrentProcess()->HasSwitch( | 25 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 26 switches::kEnableStubInteractive); | 26 chromeos::switches::kEnableStubInteractive); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 namespace chromeos { | 31 namespace chromeos { |
| 32 | 32 |
| 33 NetworkLibraryImplStub::NetworkLibraryImplStub() | 33 NetworkLibraryImplStub::NetworkLibraryImplStub() |
| 34 : ip_address_("1.1.1.1"), | 34 : ip_address_("1.1.1.1"), |
| 35 hardware_address_("01:23:45:67:89:ab"), | 35 hardware_address_("01:23:45:67:89:ab"), |
| 36 pin_(""), | 36 pin_(""), |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 cellular1->set_activation_state(ACTIVATION_STATE_ACTIVATED); | 317 cellular1->set_activation_state(ACTIVATION_STATE_ACTIVATED); |
| 318 cellular1->set_payment_url(std::string("http://www.google.com")); | 318 cellular1->set_payment_url(std::string("http://www.google.com")); |
| 319 cellular1->set_usage_url(std::string("http://www.google.com")); | 319 cellular1->set_usage_url(std::string("http://www.google.com")); |
| 320 cellular1->set_network_technology(NETWORK_TECHNOLOGY_EVDO); | 320 cellular1->set_network_technology(NETWORK_TECHNOLOGY_EVDO); |
| 321 AddStubNetwork(cellular1, PROFILE_NONE); | 321 AddStubNetwork(cellular1, PROFILE_NONE); |
| 322 | 322 |
| 323 CellularNetwork* cellular2 = new CellularNetwork("/cellular2"); | 323 CellularNetwork* cellular2 = new CellularNetwork("/cellular2"); |
| 324 cellular2->set_name("Fake Cellular 2"); | 324 cellular2->set_name("Fake Cellular 2"); |
| 325 cellular2->set_device_path(cellular->device_path()); | 325 cellular2->set_device_path(cellular->device_path()); |
| 326 cellular2->set_strength(50); | 326 cellular2->set_strength(50); |
| 327 cellular2->set_activation_state(ACTIVATION_STATE_NOT_ACTIVATED); | 327 cellular2->set_activation_state(ACTIVATION_STATE_ACTIVATING); |
| 328 cellular2->set_network_technology(NETWORK_TECHNOLOGY_UMTS); | 328 cellular2->set_network_technology(NETWORK_TECHNOLOGY_UMTS); |
| 329 cellular2->set_roaming_state(ROAMING_STATE_ROAMING); | 329 cellular2->set_roaming_state(ROAMING_STATE_ROAMING); |
| 330 cellular2->set_payment_url(std::string("http://www.google.com")); | 330 cellular2->set_payment_url(std::string("http://www.google.com")); |
| 331 cellular2->set_usage_url(std::string("http://www.google.com")); | 331 cellular2->set_usage_url(std::string("http://www.google.com")); |
| 332 AddStubNetwork(cellular2, PROFILE_NONE); | 332 AddStubNetwork(cellular2, PROFILE_NONE); |
| 333 | 333 |
| 334 CellularNetwork* cellular3 = new CellularNetwork("cellular3"); | 334 CellularNetwork* cellular3 = new CellularNetwork("cellular3"); |
| 335 cellular3->set_name("Fake Cellular 3 (policy-managed)"); | 335 cellular3->set_name("Fake Cellular 3 (policy-managed)"); |
| 336 cellular3->set_device_path(cellular->device_path()); | 336 cellular3->set_device_path(cellular->device_path()); |
| 337 cellular3->set_activation_state(ACTIVATION_STATE_ACTIVATED); | 337 cellular3->set_activation_state(ACTIVATION_STATE_ACTIVATED); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 } | 805 } |
| 806 callback.Run(service_path, dictionary.get()); | 806 callback.Run(service_path, dictionary.get()); |
| 807 } | 807 } |
| 808 | 808 |
| 809 const std::map<std::string, base::DictionaryValue*>& | 809 const std::map<std::string, base::DictionaryValue*>& |
| 810 NetworkLibraryImplStub::GetConfigurations() { | 810 NetworkLibraryImplStub::GetConfigurations() { |
| 811 return service_configurations_; | 811 return service_configurations_; |
| 812 } | 812 } |
| 813 | 813 |
| 814 } // namespace chromeos | 814 } // namespace chromeos |
| OLD | NEW |