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

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

Issue 10949030: This converts the Shill clients to allow propagation of shill errors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix bad merge Created 8 years, 2 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
« no previous file with comments | « chromeos/dbus/shill_device_client_unittest.cc ('k') | chromeos/dbus/shill_manager_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 12 matching lines...) Expand all
23 23
24 class ShillPropertyChangedObserver; 24 class ShillPropertyChangedObserver;
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 34
34 virtual ~ShillManagerClient(); 35 virtual ~ShillManagerClient();
35 36
36 // Factory function, creates a new instance which is owned by the caller. 37 // Factory function, creates a new instance which is owned by the caller.
37 // For normal usage, access the singleton via DBusThreadManager::Get(). 38 // For normal usage, access the singleton via DBusThreadManager::Get().
38 static ShillManagerClient* Create(DBusClientImplementationType type, 39 static ShillManagerClient* Create(DBusClientImplementationType type,
39 dbus::Bus* bus); 40 dbus::Bus* bus);
40 41
41 // Adds a property changed |observer|. 42 // Adds a property changed |observer|.
42 virtual void AddPropertyChangedObserver( 43 virtual void AddPropertyChangedObserver(
(...skipping 12 matching lines...) Expand all
55 // Thie method returns NULL when method call fails. 56 // Thie method returns NULL when method call fails.
56 // 57 //
57 // TODO(hashimoto): Refactor CrosGetWifiAccessPoints and remove this method. 58 // TODO(hashimoto): Refactor CrosGetWifiAccessPoints and remove this method.
58 // crosbug.com/29902 59 // crosbug.com/29902
59 virtual base::DictionaryValue* CallGetPropertiesAndBlock() = 0; 60 virtual base::DictionaryValue* CallGetPropertiesAndBlock() = 0;
60 61
61 // Calls SetProperty method. 62 // Calls SetProperty method.
62 // |callback| is called after the method call succeeds. 63 // |callback| is called after the method call succeeds.
63 virtual void SetProperty(const std::string& name, 64 virtual void SetProperty(const std::string& name,
64 const base::Value& value, 65 const base::Value& value,
65 const VoidDBusMethodCallback& callback) = 0; 66 const base::Closure& callback,
67 const ErrorCallback& error_callback) = 0;
66 68
67 // Calls RequestScan method. 69 // Calls RequestScan method.
68 // |callback| is called after the method call succeeds. 70 // |callback| is called after the method call succeeds.
69 virtual void RequestScan(const std::string& type, 71 virtual void RequestScan(const std::string& type,
70 const VoidDBusMethodCallback& callback) = 0; 72 const base::Closure& callback,
73 const ErrorCallback& error_callback) = 0;
71 74
72 // Calls EnableTechnology method. 75 // Calls EnableTechnology method.
73 // |callback| is called after the method call succeeds. 76 // |callback| is called after the method call succeeds.
74 virtual void EnableTechnology(const std::string& type, 77 virtual void EnableTechnology(const std::string& type,
75 const VoidDBusMethodCallback& callback) = 0; 78 const base::Closure& callback,
79 const ErrorCallback& error_callback) = 0;
76 80
77 // Calls DisableTechnology method. 81 // Calls DisableTechnology method.
78 // |callback| is called after the method call succeeds. 82 // |callback| is called after the method call succeeds.
79 virtual void DisableTechnology(const std::string& type, 83 virtual void DisableTechnology(const std::string& type,
80 const VoidDBusMethodCallback& callback) = 0; 84 const base::Closure& callback,
85 const ErrorCallback& error_callback) = 0;
81 86
82 // Calls ConfigureService method. 87 // Calls ConfigureService method.
83 // |callback| is called after the method call succeeds. 88 // |callback| is called after the method call succeeds.
84 virtual void ConfigureService(const base::DictionaryValue& properties, 89 virtual void ConfigureService(const base::DictionaryValue& properties,
85 const VoidDBusMethodCallback& callback) = 0; 90 const base::Closure& callback,
91 const ErrorCallback& error_callback) = 0;
86 92
87 // Calls GetService method. 93 // Calls GetService method.
88 // |callback| is called after the method call succeeds. 94 // |callback| is called after the method call succeeds.
89 virtual void GetService(const base::DictionaryValue& properties, 95 virtual void GetService(const base::DictionaryValue& properties,
90 const ObjectPathDBusMethodCallback& callback) = 0; 96 const ObjectPathCallback& callback,
97 const ErrorCallback& error_callback) = 0;
91 98
92 protected: 99 protected:
93 // Create() should be used instead. 100 // Create() should be used instead.
94 ShillManagerClient(); 101 ShillManagerClient();
95 102
96 private: 103 private:
97 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient); 104 DISALLOW_COPY_AND_ASSIGN(ShillManagerClient);
98 }; 105 };
99 106
100 } // namespace chromeos 107 } // namespace chromeos
101 108
102 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_ 109 #endif // CHROMEOS_DBUS_SHILL_MANAGER_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_device_client_unittest.cc ('k') | chromeos/dbus/shill_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698