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

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

Issue 10170020: Rework chromeos::FlimflamDevice/ServiceClient with CallMethodWithErrorCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 months 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_FLIMFLAM_SERVICE_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_
6 #define CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ 6 #define CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 31
32 // FlimflamServiceClient is used to communicate with the Flimflam Service 32 // FlimflamServiceClient is used to communicate with the Flimflam Service
33 // service. 33 // service.
34 // All methods should be called from the origin thread which initializes the 34 // All methods should be called from the origin thread which initializes the
35 // DBusThreadManager instance. 35 // DBusThreadManager instance.
36 class CHROMEOS_EXPORT FlimflamServiceClient { 36 class CHROMEOS_EXPORT FlimflamServiceClient {
37 public: 37 public:
38 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler; 38 typedef FlimflamClientHelper::PropertyChangedHandler PropertyChangedHandler;
39 typedef FlimflamClientHelper::VoidCallback VoidCallback; 39 typedef FlimflamClientHelper::VoidCallback VoidCallback;
40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback; 40 typedef FlimflamClientHelper::DictionaryValueCallback DictionaryValueCallback;
41 typedef FlimflamClientHelper::ErrorCallback ErrorCallback;
41 42
42 virtual ~FlimflamServiceClient(); 43 virtual ~FlimflamServiceClient();
43 44
44 // Factory function, creates a new instance which is owned by the caller. 45 // Factory function, creates a new instance which is owned by the caller.
45 // For normal usage, access the singleton via DBusThreadManager::Get(). 46 // For normal usage, access the singleton via DBusThreadManager::Get().
46 static FlimflamServiceClient* Create(DBusClientImplementationType type, 47 static FlimflamServiceClient* Create(DBusClientImplementationType type,
47 dbus::Bus* bus); 48 dbus::Bus* bus);
48 49
49 // Sets PropertyChanged signal handler. 50 // Sets PropertyChanged signal handler.
50 virtual void SetPropertyChangedHandler( 51 virtual void SetPropertyChangedHandler(
(...skipping 18 matching lines...) Expand all
69 70
70 // Calls ClearProperty method. 71 // Calls ClearProperty method.
71 // |callback| is called after the method call succeeds. 72 // |callback| is called after the method call succeeds.
72 virtual void ClearProperty(const dbus::ObjectPath& service_path, 73 virtual void ClearProperty(const dbus::ObjectPath& service_path,
73 const std::string& name, 74 const std::string& name,
74 const VoidCallback& callback) = 0; 75 const VoidCallback& callback) = 0;
75 76
76 // Calls Connect method. 77 // Calls Connect method.
77 // |callback| is called after the method call succeeds. 78 // |callback| is called after the method call succeeds.
78 virtual void Connect(const dbus::ObjectPath& service_path, 79 virtual void Connect(const dbus::ObjectPath& service_path,
79 const VoidCallback& callback) = 0; 80 const base::Closure& callback,
81 const ErrorCallback& error_callback) = 0;
80 82
81 // Calls Disconnect method. 83 // Calls Disconnect method.
82 // |callback| is called after the method call succeeds. 84 // |callback| is called after the method call succeeds.
83 virtual void Disconnect(const dbus::ObjectPath& service_path, 85 virtual void Disconnect(const dbus::ObjectPath& service_path,
84 const VoidCallback& callback) = 0; 86 const VoidCallback& callback) = 0;
85 87
86 // Calls Remove method. 88 // Calls Remove method.
87 // |callback| is called after the method call succeeds. 89 // |callback| is called after the method call succeeds.
88 virtual void Remove(const dbus::ObjectPath& service_path, 90 virtual void Remove(const dbus::ObjectPath& service_path,
89 const VoidCallback& callback) = 0; 91 const VoidCallback& callback) = 0;
90 92
91 // Calls ActivateCellularModem method. 93 // Calls ActivateCellularModem method.
92 // |callback| is called after the method call succeeds. 94 // |callback| is called after the method call succeeds.
93 virtual void ActivateCellularModem(const dbus::ObjectPath& service_path, 95 virtual void ActivateCellularModem(const dbus::ObjectPath& service_path,
94 const std::string& carrier, 96 const std::string& carrier,
95 const VoidCallback& callback) = 0; 97 const VoidCallback& callback) = 0;
96 98
97 protected: 99 protected:
98 // Create() should be used instead. 100 // Create() should be used instead.
99 FlimflamServiceClient(); 101 FlimflamServiceClient();
100 102
101 private: 103 private:
102 DISALLOW_COPY_AND_ASSIGN(FlimflamServiceClient); 104 DISALLOW_COPY_AND_ASSIGN(FlimflamServiceClient);
103 }; 105 };
104 106
105 } // namespace chromeos 107 } // namespace chromeos
106 108
107 #endif // CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_ 109 #endif // CHROMEOS_DBUS_FLIMFLAM_SERVICE_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/flimflam_device_client_unittest.cc ('k') | chromeos/dbus/flimflam_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698