OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/observer_list.h" | |
10 | |
11 #include <string> | |
12 | |
13 namespace dbus { | |
14 class Bus; | |
15 } // namespace | |
16 | |
17 namespace chromeos { | |
18 | |
19 // SessionManagerClient is used to communicate with the session manager. | |
20 class SessionManagerClient { | |
21 public: | |
22 // Interface for observing changes from the session manager. | |
23 class Observer { | |
24 public: | |
25 // Called when the owner key is set. | |
26 virtual void OwnerKeySet(bool success) {} | |
27 // Called when the property change is complete. | |
28 virtual void PropertyChangeComplete(bool success) {} | |
29 }; | |
30 | |
31 // Adds and removes the observer. | |
32 virtual void AddObserver(Observer* observer) = 0; | |
33 virtual void RemoveObserver(Observer* observer) = 0; | |
34 | |
35 // Kicks off an attempt to emit the "login-prompt-ready" upstart signal. | |
36 virtual void EmitLoginPromptReady() = 0; | |
37 | |
38 // Kicks off an attempt to emit the "login-prompt-visible" upstart signal. | |
39 virtual void EmitLoginPromptVisible() = 0; | |
40 | |
41 // Restarts a job referenced by |pid| with the provided command line. | |
42 virtual void RestartJob(int pid, const std::string& command_line) = 0; | |
43 | |
44 // Restarts entd (the enterprise daemon). | |
45 virtual void RestartEntd() = 0; | |
Chris Masone
2011/10/18 16:32:41
This is deprecated; we can either remove it now, o
satorux1
2011/10/18 17:49:44
RestartEntd() is called from browser/chromeos/ente
Chris Masone
2011/10/18 17:55:44
I believe so, but kmixter and rginda would know fo
| |
46 | |
47 // Starts the session for the user. | |
48 virtual void StartSession(const std::string& user_email) = 0; | |
49 | |
50 // Stops the current session. | |
51 virtual void StopSession() = 0; | |
52 | |
53 // Used for RetrievePolicy. Takes a serialized protocol buffer as string. | |
54 typedef base::Callback<void(const std::string&)> RetrievePolicyCallback; | |
55 | |
56 // Fetches the policy blob stored by the session manager. Upon | |
57 // completion of the retrieve attempt, we will call the provided | |
58 // callback. Policies are serialized protocol buffers. Upon success, | |
59 // we will pass a protobuf to the callback. On failure, we will pass | |
60 // NULL. | |
61 virtual void RetrievePolicy(RetrievePolicyCallback callback) = 0; | |
Chris Masone
2011/10/18 16:32:41
When I wrote this originally, davemoore indicated
satorux1
2011/10/18 17:49:44
Good point. I expect all D-Bus method calls to be
Chris Masone
2011/10/18 17:55:44
Fair enough
| |
62 | |
63 // Used for StorePolicyCallback. Takes a bollean indicating whether the | |
Chris Masone
2011/10/18 16:32:41
nit: boolean
satorux1
2011/10/18 17:49:44
Done.
| |
64 // operation was successful or not. | |
65 typedef base::Callback<void(bool)> StorePolicyCallback; | |
66 | |
67 // Attempts to store the policy blob |policy_blob| asynchronously. | |
68 // Upon completion of the store attempt, we will call callback(delegate, ...) | |
69 virtual void StorePolicy(const std::string& policy_bob, | |
Chris Masone
2011/10/18 16:32:41
Same comment as above.
satorux1
2011/10/18 17:49:44
Done.
| |
70 StorePolicyCallback callback) = 0; | |
71 | |
72 // Creates the instance. | |
73 static SessionManagerClient* Create(dbus::Bus* bus); | |
74 | |
75 virtual ~SessionManagerClient(); | |
76 | |
77 protected: | |
78 // Create() should be used instead. | |
79 SessionManagerClient(); | |
80 | |
81 private: | |
82 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient); | |
83 }; | |
84 | |
85 } // namespace chromeos | |
86 | |
87 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_ | |
OLD | NEW |