OLD | NEW |
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 CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" | 10 #include "chrome/browser/chromeos/dbus/dbus_client_implementation_type.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Restarts entd (the enterprise daemon). | 45 // Restarts entd (the enterprise daemon). |
46 // DEPRECATED: will be deleted soon. | 46 // DEPRECATED: will be deleted soon. |
47 virtual void RestartEntd() = 0; | 47 virtual void RestartEntd() = 0; |
48 | 48 |
49 // Starts the session for the user. | 49 // Starts the session for the user. |
50 virtual void StartSession(const std::string& user_email) = 0; | 50 virtual void StartSession(const std::string& user_email) = 0; |
51 | 51 |
52 // Stops the current session. | 52 // Stops the current session. |
53 virtual void StopSession() = 0; | 53 virtual void StopSession() = 0; |
54 | 54 |
55 // Used for RetrievePolicy. Takes a serialized protocol buffer as string. | 55 // Used for RetrieveDevicePolicy and RetrieveUserPolicy. Takes a serialized |
| 56 // protocol buffer as string. Upon success, we will pass a protobuf to the |
| 57 // callback. On failure, we will pass "". |
56 typedef base::Callback<void(const std::string&)> RetrievePolicyCallback; | 58 typedef base::Callback<void(const std::string&)> RetrievePolicyCallback; |
57 | 59 |
58 // Fetches the policy blob stored by the session manager. Upon | 60 // Fetches the device policy blob stored by the session manager. Upon |
59 // completion of the retrieve attempt, we will call the provided | 61 // completion of the retrieve attempt, we will call the provided callback. |
60 // callback. Policies are serialized protocol buffers. Upon success, | 62 virtual void RetrieveDevicePolicy(RetrievePolicyCallback callback) = 0; |
61 // we will pass a protobuf to the callback. On failure, we will pass | |
62 // "". | |
63 virtual void RetrievePolicy(RetrievePolicyCallback callback) = 0; | |
64 | 63 |
65 // Used for StorePolicyCallback. Takes a boolean indicating whether the | 64 // Fetches the user policy blob stored by the session manager for the |
66 // operation was successful or not. | 65 // currently signed-in user. Upon completion of the retrieve attempt, we will |
| 66 // call the provided callback. |
| 67 virtual void RetrieveUserPolicy(RetrievePolicyCallback callback) = 0; |
| 68 |
| 69 // Used for StoreDevicePolicy and StoreUserPolicy. Takes a boolean indicating |
| 70 // whether the operation was successful or not. |
67 typedef base::Callback<void(bool)> StorePolicyCallback; | 71 typedef base::Callback<void(bool)> StorePolicyCallback; |
68 | 72 |
69 // Attempts to store |policy_blob| asynchronously. Upon completion of | 73 // Attempts to asynchronously store |policy_blob| as device policy. Upon |
70 // the store attempt, we will call callback. | 74 // completion of the store attempt, we will call callback. |
71 virtual void StorePolicy(const std::string& policy_bob, | 75 virtual void StoreDevicePolicy(const std::string& policy_blob, |
72 StorePolicyCallback callback) = 0; | 76 StorePolicyCallback callback) = 0; |
| 77 |
| 78 // Attempts to asynchronously store |policy_blob| as user policy for the |
| 79 // currently signed-in user. Upon completion of the store attempt, we will |
| 80 // call callback. |
| 81 virtual void StoreUserPolicy(const std::string& policy_blob, |
| 82 StorePolicyCallback callback) = 0; |
73 | 83 |
74 // Creates the instance. | 84 // Creates the instance. |
75 static SessionManagerClient* Create(DBusClientImplementationType type, | 85 static SessionManagerClient* Create(DBusClientImplementationType type, |
76 dbus::Bus* bus); | 86 dbus::Bus* bus); |
77 | 87 |
78 virtual ~SessionManagerClient(); | 88 virtual ~SessionManagerClient(); |
79 | 89 |
80 protected: | 90 protected: |
81 // Create() should be used instead. | 91 // Create() should be used instead. |
82 SessionManagerClient(); | 92 SessionManagerClient(); |
83 | 93 |
84 private: | 94 private: |
85 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); | 95 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); |
86 }; | 96 }; |
87 | 97 |
88 } // namespace chromeos | 98 } // namespace chromeos |
89 | 99 |
90 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ |
OLD | NEW |