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_debug_daemon_client.h" | 5 #include "chromeos/dbus/fake_debug_daemon_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" |
13 #include "base/location.h" | 14 #include "base/location.h" |
14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "chromeos/chromeos_switches.h" |
15 | 17 |
16 namespace chromeos { | 18 namespace chromeos { |
17 | 19 |
18 FakeDebugDaemonClient::FakeDebugDaemonClient() {} | 20 FakeDebugDaemonClient::FakeDebugDaemonClient() |
| 21 : featues_mask_(DebugDaemonClient::DEV_FEATURE_NONE) { |
| 22 } |
19 | 23 |
20 FakeDebugDaemonClient::~FakeDebugDaemonClient() {} | 24 FakeDebugDaemonClient::~FakeDebugDaemonClient() {} |
21 | 25 |
22 void FakeDebugDaemonClient::Init(dbus::Bus* bus) {} | 26 void FakeDebugDaemonClient::Init(dbus::Bus* bus) {} |
23 | 27 |
24 void FakeDebugDaemonClient::DumpDebugLogs( | 28 void FakeDebugDaemonClient::DumpDebugLogs( |
25 bool is_compressed, | 29 bool is_compressed, |
26 base::File file, | 30 base::File file, |
27 scoped_refptr<base::TaskRunner> task_runner, | 31 scoped_refptr<base::TaskRunner> task_runner, |
28 const GetDebugLogsCallback& callback) { | 32 const GetDebugLogsCallback& callback) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const std::string& ip_address, | 117 const std::string& ip_address, |
114 const std::map<std::string, std::string>& options, | 118 const std::map<std::string, std::string>& options, |
115 const TestICMPCallback& callback) { | 119 const TestICMPCallback& callback) { |
116 base::MessageLoop::current()->PostTask(FROM_HERE, | 120 base::MessageLoop::current()->PostTask(FROM_HERE, |
117 base::Bind(callback, false, "")); | 121 base::Bind(callback, false, "")); |
118 } | 122 } |
119 | 123 |
120 void FakeDebugDaemonClient::UploadCrashes() { | 124 void FakeDebugDaemonClient::UploadCrashes() { |
121 } | 125 } |
122 | 126 |
| 127 void FakeDebugDaemonClient::EnableDebuggingFeatures( |
| 128 const std::string& password, |
| 129 const DebugDaemonClient::EnableDebuggingCallback& callback) { |
| 130 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 131 base::Bind(callback, true)); |
| 132 } |
| 133 |
| 134 void FakeDebugDaemonClient::SetDebuggingFeaturesStatus(int featues_mask) { |
| 135 featues_mask_ = featues_mask; |
| 136 } |
| 137 |
| 138 void FakeDebugDaemonClient::QueryDebuggingFeatures( |
| 139 const DebugDaemonClient::QueryDevFeaturesCallback& callback) { |
| 140 bool supported = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 141 chromeos::switches::kSystemDevMode); |
| 142 base::MessageLoop::current()->PostTask( |
| 143 FROM_HERE, |
| 144 base::Bind(callback, |
| 145 true, |
| 146 static_cast<int>( |
| 147 supported ? featues_mask_ : |
| 148 DebugDaemonClient::DEV_FEATURES_DISABLED))); |
| 149 } |
| 150 |
| 151 void FakeDebugDaemonClient::RemoveRootfsVerification( |
| 152 const DebugDaemonClient::EnableDebuggingCallback& callback) { |
| 153 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 154 base::Bind(callback, true)); |
| 155 } |
| 156 |
123 } // namespace chromeos | 157 } // namespace chromeos |
OLD | NEW |