| 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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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_(""), |
| 37 pin_required_(false), | 37 pin_required_(false), |
| 38 pin_entered_(false), | 38 pin_entered_(false), |
| 39 network_priority_order_(0), | 39 network_priority_order_(0), |
| 40 weak_pointer_factory_(this) { | 40 weak_pointer_factory_(this) { |
| 41 // Emulate default setting of the CheckPortalList when OOBE is done. | |
| 42 if (IsEthernetEnabled()) | |
| 43 check_portal_list_ = "ethernet,wifi,cellular"; | |
| 44 else | |
| 45 check_portal_list_ = "wifi,cellular"; | |
| 46 } | 41 } |
| 47 | 42 |
| 48 NetworkLibraryImplStub::~NetworkLibraryImplStub() { | 43 NetworkLibraryImplStub::~NetworkLibraryImplStub() { |
| 49 disabled_wifi_networks_.clear(); | 44 disabled_wifi_networks_.clear(); |
| 50 disabled_cellular_networks_.clear(); | 45 disabled_cellular_networks_.clear(); |
| 51 disabled_wimax_networks_.clear(); | 46 disabled_wimax_networks_.clear(); |
| 52 STLDeleteValues(&service_configurations_); | 47 STLDeleteValues(&service_configurations_); |
| 53 } | 48 } |
| 54 | 49 |
| 55 void NetworkLibraryImplStub::Init() { | 50 void NetworkLibraryImplStub::Init() { |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 enabled_devices_ &= ~(1 << device); | 619 enabled_devices_ &= ~(1 << device); |
| 625 } | 620 } |
| 626 SignalNetworkManagerObservers(); | 621 SignalNetworkManagerObservers(); |
| 627 } | 622 } |
| 628 | 623 |
| 629 void NetworkLibraryImplStub::CallRemoveNetwork(const Network* network) {} | 624 void NetworkLibraryImplStub::CallRemoveNetwork(const Network* network) {} |
| 630 | 625 |
| 631 ///////////////////////////////////////////////////////////////////////////// | 626 ///////////////////////////////////////////////////////////////////////////// |
| 632 // NetworkLibrary implementation. | 627 // NetworkLibrary implementation. |
| 633 | 628 |
| 634 void NetworkLibraryImplStub::SetCheckPortalList(const | |
| 635 std::string& check_portal_list) { | |
| 636 check_portal_list_ = check_portal_list; | |
| 637 } | |
| 638 | |
| 639 void NetworkLibraryImplStub::SetDefaultCheckPortalList() { | |
| 640 if (IsEthernetEnabled()) | |
| 641 SetCheckPortalList("ethernet,wifi,cellular"); | |
| 642 else | |
| 643 SetCheckPortalList("wifi,cellular"); | |
| 644 } | |
| 645 | |
| 646 void NetworkLibraryImplStub::ChangePin(const std::string& old_pin, | 629 void NetworkLibraryImplStub::ChangePin(const std::string& old_pin, |
| 647 const std::string& new_pin) { | 630 const std::string& new_pin) { |
| 648 sim_operation_ = SIM_OPERATION_CHANGE_PIN; | 631 sim_operation_ = SIM_OPERATION_CHANGE_PIN; |
| 649 if (!pin_required_ || old_pin == pin_) { | 632 if (!pin_required_ || old_pin == pin_) { |
| 650 pin_ = new_pin; | 633 pin_ = new_pin; |
| 651 NotifyPinOperationCompleted(PIN_ERROR_NONE); | 634 NotifyPinOperationCompleted(PIN_ERROR_NONE); |
| 652 } else { | 635 } else { |
| 653 NotifyPinOperationCompleted(PIN_ERROR_INCORRECT_CODE); | 636 NotifyPinOperationCompleted(PIN_ERROR_INCORRECT_CODE); |
| 654 } | 637 } |
| 655 } | 638 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 } | 801 } |
| 819 callback.Run(service_path, dictionary.get()); | 802 callback.Run(service_path, dictionary.get()); |
| 820 } | 803 } |
| 821 | 804 |
| 822 const std::map<std::string, base::DictionaryValue*>& | 805 const std::map<std::string, base::DictionaryValue*>& |
| 823 NetworkLibraryImplStub::GetConfigurations() { | 806 NetworkLibraryImplStub::GetConfigurations() { |
| 824 return service_configurations_; | 807 return service_configurations_; |
| 825 } | 808 } |
| 826 | 809 |
| 827 } // namespace chromeos | 810 } // namespace chromeos |
| OLD | NEW |