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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/dbus/session_manager_client.h
diff --git a/chrome/browser/chromeos/dbus/session_manager_client.h b/chrome/browser/chromeos/dbus/session_manager_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..961ae3eca7c44320fe747722e23382cf58ea99da
--- /dev/null
+++ b/chrome/browser/chromeos/dbus/session_manager_client.h
@@ -0,0 +1,84 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
+#define CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_
+
+#include "base/callback.h"
+#include "base/observer_list.h"
+
+#include <string>
+
+namespace dbus {
+class Bus;
+} // namespace
+
+namespace chromeos {
+
+// SessionManagerClient is used to communicate with the session manager.
+class SessionManagerClient {
+ public:
+ // Interface for observing changes from the session manager.
+ class Observer {
+ public:
+ // Callend when the owner key is set.
stevenjb 2011/10/17 18:32:56 Called
satorux1 2011/10/17 21:24:44 Done.
+ virtual void OwnerKeySet(bool success) {}
+ // Called when the property change is complete.
+ virtual void PropertyChangeComplete(bool success) {}
+ };
+
+ // Adds and removes the observer.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ typedef base::Callback<void(const std::string&)> RetrievePolicyCallback;
+ 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.
+
+ // Kicks off an attempt to emit the "login-prompt-ready" upstart signal.
+ virtual void EmitLoginPromptReady() = 0;
+
+ // Kicks off an attempt to emit the "login-prompt-visible" upstart signal.
+ virtual void EmitLoginPromptVisible() = 0;
+
+ // 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.
+ virtual void RestartJob(int pid, const std::string& command_line) = 0;
+
+ // Restarts entd (the enterprise daemon).
+ virtual void RestartEntd() = 0;
+
+ // Starts the session for the user.
+ virtual void StartSession(const std::string& user_email) = 0;
+
+ // Stops the current session.
+ virtual void StopSession() = 0;
+
+ // Fetches the policy blob stored by the session manager. Upon
+ // completion of the retrieve attempt, we will call the provided
+ // callback. Policies are serialized protocol buffers. Upon success,
+ // we will pass a protobuf to the callback. On failure, we will pass
+ // NULL.
+ virtual void RetrievePolicy(RetrievePolicyCallback callback) = 0;
+
+ // 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.
+ // 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.
+ // Upon completion of the store attempt, we will call callback(delegate, ...)
+ virtual void StorePolicy(const std::string& policy_bob,
+ StorePolicyCallback callback) = 0;
+
+ // Creates the instance.
+ static SessionManagerClient* Create(dbus::Bus* bus);
+
+ virtual ~SessionManagerClient();
+
+ protected:
+ // Create() should be used instead.
+ SessionManagerClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SessionManagerClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_DBUS_SESSION_MANAGER_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698