OLD | NEW |
---|---|
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 } | 20 arc_available_(false) {} |
bartfab (slow)
2016/03/02 14:45:40
Nit: Put the closing curly brace on its own line.
Polina Bondarenko
2016/03/06 20:22:33
Formatting tool (git cl format) fixes it back:(
bartfab (slow)
2016/03/07 13:44:04
Then the tool disagrees with the style guide, but
| |
21 | 21 |
22 FakeSessionManagerClient::~FakeSessionManagerClient() { | 22 FakeSessionManagerClient::~FakeSessionManagerClient() { |
23 } | 23 } |
24 | 24 |
25 void FakeSessionManagerClient::Init(dbus::Bus* bus) { | 25 void FakeSessionManagerClient::Init(dbus::Bus* bus) { |
26 } | 26 } |
27 | 27 |
28 void FakeSessionManagerClient::SetStubDelegate(StubDelegate* delegate) { | 28 void FakeSessionManagerClient::SetStubDelegate(StubDelegate* delegate) { |
29 } | 29 } |
30 | 30 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 } | 146 } |
147 | 147 |
148 void FakeSessionManagerClient::GetServerBackedStateKeys( | 148 void FakeSessionManagerClient::GetServerBackedStateKeys( |
149 const StateKeysCallback& callback) { | 149 const StateKeysCallback& callback) { |
150 base::ThreadTaskRunnerHandle::Get()->PostTask( | 150 base::ThreadTaskRunnerHandle::Get()->PostTask( |
151 FROM_HERE, base::Bind(callback, server_backed_state_keys_)); | 151 FROM_HERE, base::Bind(callback, server_backed_state_keys_)); |
152 } | 152 } |
153 | 153 |
154 void FakeSessionManagerClient::CheckArcAvailability( | 154 void FakeSessionManagerClient::CheckArcAvailability( |
155 const ArcCallback& callback) { | 155 const ArcCallback& callback) { |
156 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 156 base::ThreadTaskRunnerHandle::Get()->PostTask( |
157 base::Bind(callback, false)); | 157 FROM_HERE, base::Bind(callback, arc_available_)); |
158 } | 158 } |
159 | 159 |
160 void FakeSessionManagerClient::StartArcInstance(const std::string& socket_path, | 160 void FakeSessionManagerClient::StartArcInstance(const std::string& socket_path, |
161 const ArcCallback& callback) { | 161 const ArcCallback& callback) { |
162 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 162 base::ThreadTaskRunnerHandle::Get()->PostTask( |
163 base::Bind(callback, false)); | 163 FROM_HERE, base::Bind(callback, arc_available_)); |
164 } | 164 } |
165 | 165 |
166 void FakeSessionManagerClient::StopArcInstance(const ArcCallback& callback) { | 166 void FakeSessionManagerClient::StopArcInstance(const ArcCallback& callback) { |
167 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 167 base::ThreadTaskRunnerHandle::Get()->PostTask( |
168 base::Bind(callback, false)); | 168 FROM_HERE, base::Bind(callback, arc_available_)); |
169 } | 169 } |
170 | 170 |
171 const std::string& FakeSessionManagerClient::device_policy() const { | 171 const std::string& FakeSessionManagerClient::device_policy() const { |
172 return device_policy_; | 172 return device_policy_; |
173 } | 173 } |
174 | 174 |
175 void FakeSessionManagerClient::set_device_policy( | 175 void FakeSessionManagerClient::set_device_policy( |
176 const std::string& policy_blob) { | 176 const std::string& policy_blob) { |
177 device_policy_ = policy_blob; | 177 device_policy_ = policy_blob; |
178 } | 178 } |
(...skipping 22 matching lines...) Expand all Loading... | |
201 const std::string& account_id, | 201 const std::string& account_id, |
202 const std::string& policy_blob) { | 202 const std::string& policy_blob) { |
203 device_local_account_policy_[account_id] = policy_blob; | 203 device_local_account_policy_[account_id] = policy_blob; |
204 } | 204 } |
205 | 205 |
206 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { | 206 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { |
207 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); | 207 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); |
208 } | 208 } |
209 | 209 |
210 } // namespace chromeos | 210 } // namespace chromeos |
OLD | NEW |