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

Side by Side Diff: chrome/browser/chromeos/dbus/session_manager_client.h

Issue 8295019: chromeos: Implement the new D-Bus client for SessionManagerClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
(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 // Callend when the owner key is set.
stevenjb 2011/10/17 18:32:56 Called
satorux1 2011/10/17 21:24:44 Done.
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 typedef base::Callback<void(const std::string&)> RetrievePolicyCallback;
36 typedef base::Callback<void(bool)> StorePolicyCallback;
stevenjb 2011/10/17 18:32:56 nit: move typedefs above virtuals or near where th
satorux1 2011/10/17 21:24:44 Done.
37
38 // Kicks off an attempt to emit the "login-prompt-ready" upstart signal.
39 virtual void EmitLoginPromptReady() = 0;
40
41 // Kicks off an attempt to emit the "login-prompt-visible" upstart signal.
42 virtual void EmitLoginPromptVisible() = 0;
43
44 // Restarts a job pointed by |pid| with the provided command line.
stevenjb 2011/10/17 18:32:56 nit: s/pointed by/pointed to by/ [or "referenced b
satorux1 2011/10/17 21:24:44 Done.
45 virtual void RestartJob(int pid, const std::string& command_line) = 0;
46
47 // Restarts entd (the enterprise daemon).
48 virtual void RestartEntd() = 0;
49
50 // Starts the session for the user.
51 virtual void StartSession(const std::string& user_email) = 0;
52
53 // Stops the current session.
54 virtual void StopSession() = 0;
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;
62
63 // Attempts to store the policy blob |prop| asynchronously.
stevenjb 2011/10/17 18:32:56 |prop| or |policy_blob|?
satorux1 2011/10/17 21:24:44 Done.
64 // Takes |len| because |prop| may have embedded NULL characters.
stevenjb 2011/10/17 18:32:56 std::string, so no more |len|
satorux1 2011/10/17 21:24:44 Done.
65 // Upon completion of the store attempt, we will call callback(delegate, ...)
66 virtual void StorePolicy(const std::string& policy_bob,
67 StorePolicyCallback callback) = 0;
68
69 // Creates the instance.
70 static SessionManagerClient* Create(dbus::Bus* bus);
71
72 virtual ~SessionManagerClient();
73
74 protected:
75 // Create() should be used instead.
76 SessionManagerClient();
77
78 private:
79 DISALLOW_COPY_AND_ASSIGN(SessionManagerClient);
80 };
81
82 } // namespace chromeos
83
84 #endif // CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698