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

Side by Side Diff: chromeos/dbus/fake_session_manager_client.cc

Issue 1829703002: Add ArcEnabled policy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments. Created 4 years, 8 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
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | components/arc.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chromeos/dbus/fake_session_manager_client.h" 5 #include "chromeos/dbus/fake_session_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "chromeos/dbus/cryptohome_client.h" 12 #include "chromeos/dbus/cryptohome_client.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 FakeSessionManagerClient::FakeSessionManagerClient() 16 FakeSessionManagerClient::FakeSessionManagerClient()
17 : start_device_wipe_call_count_(0), 17 : start_device_wipe_call_count_(0),
18 notify_lock_screen_shown_call_count_(0), 18 notify_lock_screen_shown_call_count_(0),
19 notify_lock_screen_dismissed_call_count_(0) {} 19 notify_lock_screen_dismissed_call_count_(0),
20 arc_available_(false) {}
20 21
21 FakeSessionManagerClient::~FakeSessionManagerClient() { 22 FakeSessionManagerClient::~FakeSessionManagerClient() {
22 } 23 }
23 24
24 void FakeSessionManagerClient::Init(dbus::Bus* bus) { 25 void FakeSessionManagerClient::Init(dbus::Bus* bus) {
25 } 26 }
26 27
27 void FakeSessionManagerClient::SetStubDelegate(StubDelegate* delegate) { 28 void FakeSessionManagerClient::SetStubDelegate(StubDelegate* delegate) {
28 } 29 }
29 30
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 const std::vector<std::string>& flags) {} 146 const std::vector<std::string>& flags) {}
146 147
147 void FakeSessionManagerClient::GetServerBackedStateKeys( 148 void FakeSessionManagerClient::GetServerBackedStateKeys(
148 const StateKeysCallback& callback) { 149 const StateKeysCallback& callback) {
149 base::ThreadTaskRunnerHandle::Get()->PostTask( 150 base::ThreadTaskRunnerHandle::Get()->PostTask(
150 FROM_HERE, base::Bind(callback, server_backed_state_keys_)); 151 FROM_HERE, base::Bind(callback, server_backed_state_keys_));
151 } 152 }
152 153
153 void FakeSessionManagerClient::CheckArcAvailability( 154 void FakeSessionManagerClient::CheckArcAvailability(
154 const ArcCallback& callback) { 155 const ArcCallback& callback) {
155 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 156 base::ThreadTaskRunnerHandle::Get()->PostTask(
156 base::Bind(callback, false)); 157 FROM_HERE, base::Bind(callback, arc_available_));
157 } 158 }
158 159
159 void FakeSessionManagerClient::StartArcInstance(const std::string& socket_path, 160 void FakeSessionManagerClient::StartArcInstance(const std::string& socket_path,
160 const ArcCallback& callback) { 161 const ArcCallback& callback) {
161 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 162 base::ThreadTaskRunnerHandle::Get()->PostTask(
162 base::Bind(callback, false)); 163 FROM_HERE, base::Bind(callback, arc_available_));
163 } 164 }
164 165
165 void FakeSessionManagerClient::StopArcInstance(const ArcCallback& callback) { 166 void FakeSessionManagerClient::StopArcInstance(const ArcCallback& callback) {
166 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 167 base::ThreadTaskRunnerHandle::Get()->PostTask(
167 base::Bind(callback, false)); 168 FROM_HERE, base::Bind(callback, arc_available_));
168 } 169 }
169 170
170 const std::string& FakeSessionManagerClient::device_policy() const { 171 const std::string& FakeSessionManagerClient::device_policy() const {
171 return device_policy_; 172 return device_policy_;
172 } 173 }
173 174
174 void FakeSessionManagerClient::set_device_policy( 175 void FakeSessionManagerClient::set_device_policy(
175 const std::string& policy_blob) { 176 const std::string& policy_blob) {
176 device_policy_ = policy_blob; 177 device_policy_ = policy_blob;
177 } 178 }
(...skipping 23 matching lines...) Expand all
201 const std::string& account_id, 202 const std::string& account_id,
202 const std::string& policy_blob) { 203 const std::string& policy_blob) {
203 device_local_account_policy_[account_id] = policy_blob; 204 device_local_account_policy_[account_id] = policy_blob;
204 } 205 }
205 206
206 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { 207 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) {
207 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); 208 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success));
208 } 209 }
209 210
210 } // namespace chromeos 211 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_session_manager_client.h ('k') | components/arc.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698