| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ | 5 #ifndef COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ |
| 6 #define COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ | 6 #define COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "components/wifi/network_properties.h" | 12 #include "components/wifi/network_properties.h" |
| 11 #include "components/wifi/wifi_service.h" | 13 #include "components/wifi/wifi_service.h" |
| 12 | 14 |
| 13 namespace wifi { | 15 namespace wifi { |
| 14 | 16 |
| 15 // Fake implementation of WiFiService used to satisfy expectations of | 17 // Fake implementation of WiFiService used to satisfy expectations of |
| 16 // networkingPrivateApi browser test. | 18 // networkingPrivateApi browser test. |
| 17 class FakeWiFiService : public WiFiService { | 19 class FakeWiFiService : public WiFiService { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 void StartDisconnect(const std::string& network_guid, | 49 void StartDisconnect(const std::string& network_guid, |
| 48 std::string* error) override; | 50 std::string* error) override; |
| 49 void GetKeyFromSystem(const std::string& network_guid, | 51 void GetKeyFromSystem(const std::string& network_guid, |
| 50 std::string* key_data, | 52 std::string* key_data, |
| 51 std::string* error) override; | 53 std::string* error) override; |
| 52 void SetEventObservers( | 54 void SetEventObservers( |
| 53 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 55 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, |
| 54 const NetworkGuidListCallback& networks_changed_observer, | 56 const NetworkGuidListCallback& networks_changed_observer, |
| 55 const NetworkGuidListCallback& network_list_changed_observer) override; | 57 const NetworkGuidListCallback& network_list_changed_observer) override; |
| 56 void RequestConnectedNetworkUpdate() override; | 58 void RequestConnectedNetworkUpdate() override; |
| 59 void GetConnectedNetworkSSID(std::string* ssid, |
| 60 std::string* error) override; |
| 57 | 61 |
| 58 private: | 62 private: |
| 59 NetworkList::iterator FindNetwork(const std::string& network_guid); | 63 NetworkList::iterator FindNetwork(const std::string& network_guid); |
| 60 | 64 |
| 61 void DisconnectAllNetworksOfType(const std::string& type); | 65 void DisconnectAllNetworksOfType(const std::string& type); |
| 62 | 66 |
| 63 void SortNetworks(); | 67 void SortNetworks(); |
| 64 | 68 |
| 65 void NotifyNetworkListChanged(const NetworkList& networks); | 69 void NotifyNetworkListChanged(const NetworkList& networks); |
| 66 | 70 |
| 67 void NotifyNetworkChanged(const std::string& network_guid); | 71 void NotifyNetworkChanged(const std::string& network_guid); |
| 68 | 72 |
| 69 NetworkList networks_; | 73 NetworkList networks_; |
| 70 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 74 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 71 NetworkGuidListCallback networks_changed_observer_; | 75 NetworkGuidListCallback networks_changed_observer_; |
| 72 NetworkGuidListCallback network_list_changed_observer_; | 76 NetworkGuidListCallback network_list_changed_observer_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService); | 78 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace wifi | 81 } // namespace wifi |
| 78 | 82 |
| 79 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ | 83 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ |
| OLD | NEW |