Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1082)

Side by Side Diff: chromeos/dbus/shill_manager_client.h

Issue 11192024: Add chromeos::NetworkStateManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang fixes Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ 6 #define CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // ShillManagerClient is used to communicate with the Shill Manager 26 // ShillManagerClient is used to communicate with the Shill Manager
27 // service. All methods should be called from the origin thread which 27 // service. All methods should be called from the origin thread which
28 // initializes the DBusThreadManager instance. 28 // initializes the DBusThreadManager instance.
29 class CHROMEOS_EXPORT ShillManagerClient { 29 class CHROMEOS_EXPORT ShillManagerClient {
30 public: 30 public:
31 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler; 31 typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
32 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback; 32 typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
33 typedef ShillClientHelper::ErrorCallback ErrorCallback; 33 typedef ShillClientHelper::ErrorCallback ErrorCallback;
34 34
35 // Interface for setting up devices, services, and technologies for testing.
36 // Accessed through GetTestInterface(), only implemented in the Stub Impl.
37 class TestInterface {
38 public:
39 virtual void AddDevice(const std::string& device_path) = 0;
40 virtual void RemoveDevice(const std::string& device_path) = 0;
41 virtual void AddService(const std::string& service_path,
42 bool add_to_watch_list) = 0;
43 virtual void InsertService(const std::string& service_path,
44 size_t index) = 0;
45 virtual void RemoveService(const std::string& service_path) = 0;
46 virtual void AddTechnology(const std::string& type, bool enabled) = 0;
47 virtual void RemoveTechnology(const std::string& type) = 0;
48 virtual void ClearProperties() = 0;
49
50 protected:
51 ~TestInterface() {}
52 };
53
35 virtual ~ShillManagerClient(); 54 virtual ~ShillManagerClient();
36 55
37 // Factory function, creates a new instance which is owned by the caller. 56 // Factory function, creates a new instance which is owned by the caller.
38 // For normal usage, access the singleton via DBusThreadManager::Get(). 57 // For normal usage, access the singleton via DBusThreadManager::Get().
39 static ShillManagerClient* Create(DBusClientImplementationType type, 58 static ShillManagerClient* Create(DBusClientImplementationType type,
40 dbus::Bus* bus); 59 dbus::Bus* bus);
41 60
42 // Adds a property changed |observer|. 61 // Adds a property changed |observer|.
43 virtual void AddPropertyChangedObserver( 62 virtual void AddPropertyChangedObserver(
44 ShillPropertyChangedObserver* observer) = 0; 63 ShillPropertyChangedObserver* observer) = 0;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual void ConfigureService(const base::DictionaryValue& properties, 108 virtual void ConfigureService(const base::DictionaryValue& properties,
90 const base::Closure& callback, 109 const base::Closure& callback,
91 const ErrorCallback& error_callback) = 0; 110 const ErrorCallback& error_callback) = 0;
92 111
93 // Calls GetService method. 112 // Calls GetService method.
94 // |callback| is called after the method call succeeds. 113 // |callback| is called after the method call succeeds.
95 virtual void GetService(const base::DictionaryValue& properties, 114 virtual void GetService(const base::DictionaryValue& properties,
96 const ObjectPathCallback& callback, 115 const ObjectPathCallback& callback,
97 const ErrorCallback& error_callback) = 0; 116 const ErrorCallback& error_callback) = 0;
98 117
118 // Returns an interface for testing (stub only), or returns NULL.
119 virtual TestInterface* GetTestInterface() = 0;
120
99 protected: 121 protected:
100 // Create() should be used instead. 122 // Create() should be used instead.
101 ShillManagerClient(); 123 ShillManagerClient();
102 124
103 private: 125 private:
104 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); 126 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient);
105 }; 127 };
106 128
107 } // namespace chromeos 129 } // namespace chromeos
108 130
109 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ 131 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698