OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ |
6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ | 6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const std::string& device_serial, | 77 const std::string& device_serial, |
78 const std::string& data, | 78 const std::string& data, |
79 const StringCallback& callback, | 79 const StringCallback& callback, |
80 const ErrorCallback& error_callback) OVERRIDE; | 80 const ErrorCallback& error_callback) OVERRIDE; |
81 virtual ShillManagerClient::TestInterface* GetTestInterface() OVERRIDE; | 81 virtual ShillManagerClient::TestInterface* GetTestInterface() OVERRIDE; |
82 | 82 |
83 // ShillManagerClient::TestInterface overrides. | 83 // ShillManagerClient::TestInterface overrides. |
84 | 84 |
85 virtual void AddDevice(const std::string& device_path) OVERRIDE; | 85 virtual void AddDevice(const std::string& device_path) OVERRIDE; |
86 virtual void RemoveDevice(const std::string& device_path) OVERRIDE; | 86 virtual void RemoveDevice(const std::string& device_path) OVERRIDE; |
87 virtual void ResetDevices() OVERRIDE; | 87 virtual void ClearDevices() OVERRIDE; |
88 virtual void AddService(const std::string& service_path, | 88 virtual void AddService(const std::string& service_path, |
89 bool add_to_watch_list) OVERRIDE; | 89 bool add_to_watch_list) OVERRIDE; |
90 virtual void AddServiceAtIndex(const std::string& service_path, | 90 virtual void AddServiceAtIndex(const std::string& service_path, |
91 size_t index, | 91 size_t index, |
92 bool add_to_watch_list) OVERRIDE; | 92 bool add_to_watch_list) OVERRIDE; |
93 virtual void RemoveService(const std::string& service_path) OVERRIDE; | 93 virtual void RemoveService(const std::string& service_path) OVERRIDE; |
94 virtual void AddTechnology(const std::string& type, bool enabled) OVERRIDE; | 94 virtual void AddTechnology(const std::string& type, bool enabled) OVERRIDE; |
95 virtual void RemoveTechnology(const std::string& type) OVERRIDE; | 95 virtual void RemoveTechnology(const std::string& type) OVERRIDE; |
96 virtual void ClearProperties() OVERRIDE; | 96 virtual void ClearProperties() OVERRIDE; |
97 virtual void AddGeoNetwork(const std::string& technology, | 97 virtual void AddGeoNetwork(const std::string& technology, |
98 const base::DictionaryValue& network) OVERRIDE; | 98 const base::DictionaryValue& network) OVERRIDE; |
99 | 99 |
100 private: | 100 private: |
101 void AddServiceToWatchList(const std::string& service_path); | 101 void AddServiceToWatchList(const std::string& service_path); |
102 void SetDefaultProperties(); | 102 void SetDefaultProperties(); |
103 void PassStubProperties(const DictionaryValueCallback& callback) const; | 103 void PassStubProperties(const DictionaryValueCallback& callback) const; |
104 void PassStubGeoNetworks(const DictionaryValueCallback& callback) const; | 104 void PassStubGeoNetworks(const DictionaryValueCallback& callback) const; |
105 void CallNotifyObserversPropertyChanged(const std::string& property, | 105 void CallNotifyObserversPropertyChanged(const std::string& property, |
106 int delay_ms); | 106 int delay_ms); |
107 void NotifyObserversPropertyChanged(const std::string& property); | 107 void NotifyObserversPropertyChanged(const std::string& property); |
108 base::ListValue* GetListProperty(const std::string& property); | 108 base::ListValue* GetListProperty(const std::string& property); |
| 109 bool TechnologyEnabled(const std::string& type) const; |
| 110 base::ListValue* GetEnabledServiceList(const std::string& property) const; |
109 | 111 |
110 // Dictionary of property name -> property value | 112 // Dictionary of property name -> property value |
111 base::DictionaryValue stub_properties_; | 113 base::DictionaryValue stub_properties_; |
112 // Dictionary of technology -> list of property dictionaries | 114 // Dictionary of technology -> list of property dictionaries |
113 base::DictionaryValue stub_geo_networks_; | 115 base::DictionaryValue stub_geo_networks_; |
114 | 116 |
115 ObserverList<ShillPropertyChangedObserver> observer_list_; | 117 ObserverList<ShillPropertyChangedObserver> observer_list_; |
116 | 118 |
117 // Note: This should remain the last member so it'll be destroyed and | 119 // Note: This should remain the last member so it'll be destroyed and |
118 // invalidate its weak pointers before any other members are destroyed. | 120 // invalidate its weak pointers before any other members are destroyed. |
119 base::WeakPtrFactory<ShillManagerClientStub> weak_ptr_factory_; | 121 base::WeakPtrFactory<ShillManagerClientStub> weak_ptr_factory_; |
120 | 122 |
121 DISALLOW_COPY_AND_ASSIGN(ShillManagerClientStub); | 123 DISALLOW_COPY_AND_ASSIGN(ShillManagerClientStub); |
122 }; | 124 }; |
123 | 125 |
124 } // namespace chromeos | 126 } // namespace chromeos |
125 | 127 |
126 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ | 128 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_STUB_H_ |
OLD | NEW |