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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/wifi/network_properties.h" | 10 #include "components/wifi/network_properties.h" |
11 #include "components/wifi/wifi_service.h" | 11 #include "components/wifi/wifi_service.h" |
12 | 12 |
13 namespace wifi { | 13 namespace wifi { |
14 | 14 |
15 // Fake implementation of WiFiService used to satisfy expectations of | 15 // Fake implementation of WiFiService used to satisfy expectations of |
16 // networkingPrivateApi browser test. | 16 // networkingPrivateApi browser test. |
17 class FakeWiFiService : public WiFiService { | 17 class FakeWiFiService : public WiFiService { |
18 public: | 18 public: |
19 FakeWiFiService(); | 19 FakeWiFiService(); |
20 virtual ~FakeWiFiService(); | 20 virtual ~FakeWiFiService(); |
21 | 21 |
22 virtual void Initialize( | 22 virtual void Initialize( |
23 scoped_refptr<base::SequencedTaskRunner> task_runner) OVERRIDE; | 23 scoped_refptr<base::SequencedTaskRunner> task_runner) override; |
24 virtual void UnInitialize() OVERRIDE; | 24 virtual void UnInitialize() override; |
25 virtual void GetProperties(const std::string& network_guid, | 25 virtual void GetProperties(const std::string& network_guid, |
26 base::DictionaryValue* properties, | 26 base::DictionaryValue* properties, |
27 std::string* error) OVERRIDE; | 27 std::string* error) override; |
28 virtual void GetManagedProperties(const std::string& network_guid, | 28 virtual void GetManagedProperties(const std::string& network_guid, |
29 base::DictionaryValue* managed_properties, | 29 base::DictionaryValue* managed_properties, |
30 std::string* error) OVERRIDE; | 30 std::string* error) override; |
31 virtual void GetState(const std::string& network_guid, | 31 virtual void GetState(const std::string& network_guid, |
32 base::DictionaryValue* properties, | 32 base::DictionaryValue* properties, |
33 std::string* error) OVERRIDE; | 33 std::string* error) override; |
34 virtual void SetProperties(const std::string& network_guid, | 34 virtual void SetProperties(const std::string& network_guid, |
35 scoped_ptr<base::DictionaryValue> properties, | 35 scoped_ptr<base::DictionaryValue> properties, |
36 std::string* error) OVERRIDE; | 36 std::string* error) override; |
37 virtual void CreateNetwork(bool shared, | 37 virtual void CreateNetwork(bool shared, |
38 scoped_ptr<base::DictionaryValue> properties, | 38 scoped_ptr<base::DictionaryValue> properties, |
39 std::string* network_guid, | 39 std::string* network_guid, |
40 std::string* error) OVERRIDE; | 40 std::string* error) override; |
41 virtual void GetVisibleNetworks(const std::string& network_type, | 41 virtual void GetVisibleNetworks(const std::string& network_type, |
42 base::ListValue* network_list, | 42 base::ListValue* network_list, |
43 bool include_details) OVERRIDE; | 43 bool include_details) override; |
44 virtual void RequestNetworkScan() OVERRIDE; | 44 virtual void RequestNetworkScan() override; |
45 virtual void StartConnect(const std::string& network_guid, | 45 virtual void StartConnect(const std::string& network_guid, |
46 std::string* error) OVERRIDE; | 46 std::string* error) override; |
47 virtual void StartDisconnect(const std::string& network_guid, | 47 virtual void StartDisconnect(const std::string& network_guid, |
48 std::string* error) OVERRIDE; | 48 std::string* error) override; |
49 virtual void GetKeyFromSystem(const std::string& network_guid, | 49 virtual void GetKeyFromSystem(const std::string& network_guid, |
50 std::string* key_data, | 50 std::string* key_data, |
51 std::string* error) OVERRIDE; | 51 std::string* error) override; |
52 virtual void SetEventObservers( | 52 virtual void SetEventObservers( |
53 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 53 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, |
54 const NetworkGuidListCallback& networks_changed_observer, | 54 const NetworkGuidListCallback& networks_changed_observer, |
55 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE; | 55 const NetworkGuidListCallback& network_list_changed_observer) override; |
56 virtual void RequestConnectedNetworkUpdate() OVERRIDE; | 56 virtual void RequestConnectedNetworkUpdate() override; |
57 | 57 |
58 private: | 58 private: |
59 NetworkList::iterator FindNetwork(const std::string& network_guid); | 59 NetworkList::iterator FindNetwork(const std::string& network_guid); |
60 | 60 |
61 void DisconnectAllNetworksOfType(const std::string& type); | 61 void DisconnectAllNetworksOfType(const std::string& type); |
62 | 62 |
63 void SortNetworks(); | 63 void SortNetworks(); |
64 | 64 |
65 void NotifyNetworkListChanged(const NetworkList& networks); | 65 void NotifyNetworkListChanged(const NetworkList& networks); |
66 | 66 |
67 void NotifyNetworkChanged(const std::string& network_guid); | 67 void NotifyNetworkChanged(const std::string& network_guid); |
68 | 68 |
69 NetworkList networks_; | 69 NetworkList networks_; |
70 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 70 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
71 NetworkGuidListCallback networks_changed_observer_; | 71 NetworkGuidListCallback networks_changed_observer_; |
72 NetworkGuidListCallback network_list_changed_observer_; | 72 NetworkGuidListCallback network_list_changed_observer_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService); | 74 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace wifi | 77 } // namespace wifi |
78 | 78 |
79 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ | 79 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_ |
OLD | NEW |