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

Unified Diff: chromeos/dbus/fake_session_manager_client.cc

Issue 12218078: Implement a policy to autologin a public account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: r3b@$3 Created 7 years, 9 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
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_session_manager_client.cc
diff --git a/chromeos/dbus/fake_session_manager_client.cc b/chromeos/dbus/fake_session_manager_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b671ec06a5bde71ede269db89f8ca83ad65cf01
--- /dev/null
+++ b/chromeos/dbus/fake_session_manager_client.cc
@@ -0,0 +1,144 @@
+// Copyright 2013 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.
+
+#include "chromeos/dbus/fake_session_manager_client.h"
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/message_loop.h"
+#include "base/string_util.h"
+
+namespace chromeos {
+
+FakeSessionManagerClient::FakeSessionManagerClient() {
+}
+
+FakeSessionManagerClient::~FakeSessionManagerClient() {
+}
+
+void FakeSessionManagerClient::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void FakeSessionManagerClient::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+bool FakeSessionManagerClient::HasObserver(Observer* observer) {
+ return observers_.HasObserver(observer);
+}
+
+void FakeSessionManagerClient::EmitLoginPromptReady() {
+}
+
+void FakeSessionManagerClient::EmitLoginPromptVisible() {
+}
+
+void FakeSessionManagerClient::RestartJob(int pid,
+ const std::string& command_line) {
+}
+
+void FakeSessionManagerClient::RestartEntd() {
+}
+
+void FakeSessionManagerClient::StartSession(const std::string& user_email) {
+}
+
+void FakeSessionManagerClient::StopSession() {
+}
+
+void FakeSessionManagerClient::StartDeviceWipe() {
+}
+
+void FakeSessionManagerClient::RequestLockScreen() {
+}
+
+void FakeSessionManagerClient::NotifyLockScreenShown() {
+}
+
+void FakeSessionManagerClient::RequestUnlockScreen() {
+}
+
+void FakeSessionManagerClient::NotifyLockScreenDismissed() {
+}
+
+void FakeSessionManagerClient::RetrieveDevicePolicy(
+ const RetrievePolicyCallback& callback) {
+ MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, device_policy_));
+}
+
+void FakeSessionManagerClient::RetrieveUserPolicy(
+ const RetrievePolicyCallback& callback) {
+ MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, user_policy_));
+}
+
+void FakeSessionManagerClient::RetrieveDeviceLocalAccountPolicy(
+ const std::string& account_id,
+ const RetrievePolicyCallback& callback) {
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, device_local_account_policy_[account_id]));
+}
+
+void FakeSessionManagerClient::StoreDevicePolicy(
+ const std::string& policy_blob,
+ const StorePolicyCallback& callback) {
+ device_policy_ = policy_blob;
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true));
+ FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(true));
+}
+
+void FakeSessionManagerClient::StoreUserPolicy(
+ const std::string& policy_blob,
+ const StorePolicyCallback& callback) {
+ user_policy_ = policy_blob;
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true));
+}
+
+void FakeSessionManagerClient::StoreDeviceLocalAccountPolicy(
+ const std::string& account_id,
+ const std::string& policy_blob,
+ const StorePolicyCallback& callback) {
+ device_local_account_policy_[account_id] = policy_blob;
+ MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, true));
+}
+
+const std::string& FakeSessionManagerClient::device_policy() const {
+ return device_policy_;
+}
+
+void FakeSessionManagerClient::set_device_policy(
+ const std::string& policy_blob) {
+ device_policy_ = policy_blob;
+}
+
+const std::string& FakeSessionManagerClient::user_policy() const {
+ return user_policy_;
+}
+
+void FakeSessionManagerClient::set_user_policy(const std::string& policy_blob) {
+ user_policy_ = policy_blob;
+}
+
+const std::string& FakeSessionManagerClient::device_local_account_policy(
+ const std::string& account_id) const {
+ std::map<std::string, std::string>::const_iterator entry =
+ device_local_account_policy_.find(account_id);
+ return entry != device_local_account_policy_.end() ? entry->second
+ : EmptyString();
+}
+
+void FakeSessionManagerClient::set_device_local_account_policy(
+ const std::string& account_id,
+ const std::string& policy_blob) {
+ device_local_account_policy_[account_id] = policy_blob;
+}
+
+void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) {
+ FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success));
+}
+
+} // namespace chromeos
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698