summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_debug_daemon_client.cc
diff options
context:
space:
mode:
authorzelidrag <zelidrag@chromium.org>2014-11-13 20:05:53 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-14 04:06:10 +0000
commit459b11b10f0f18c4111bcfa973be5244171f1412 (patch)
tree9fbaf5f612ccf17981138a87fc11e989494bc486 /chromeos/dbus/fake_debug_daemon_client.cc
parent04a9958219dd71e823dc04819abe75b5f9eb7e38 (diff)
downloadchromium_src-459b11b10f0f18c4111bcfa973be5244171f1412.zip
chromium_src-459b11b10f0f18c4111bcfa973be5244171f1412.tar.gz
chromium_src-459b11b10f0f18c4111bcfa973be5244171f1412.tar.bz2
Added UI to enable debugging features on CrOS
BUG=403165 TEST=EnableDebuggingNonDevTest.NoShowInNonDevMode, EnableDebuggingTest.ShowAndCancelRemoveProtection, EnableDebuggingTest.ShowAndRemoveProtection, EnableDebuggingTest.ShowSetup, WizardControllerEnableDebuggingTest.ShowAndCancelEnableDebugging TBR=mnissler Review URL: https://codereview.chromium.org/539273002 Cr-Commit-Position: refs/heads/master@{#304161}
Diffstat (limited to 'chromeos/dbus/fake_debug_daemon_client.cc')
-rw-r--r--chromeos/dbus/fake_debug_daemon_client.cc36
1 files changed, 35 insertions, 1 deletions
diff --git a/chromeos/dbus/fake_debug_daemon_client.cc b/chromeos/dbus/fake_debug_daemon_client.cc
index a1d75f6..22837bc 100644
--- a/chromeos/dbus/fake_debug_daemon_client.cc
+++ b/chromeos/dbus/fake_debug_daemon_client.cc
@@ -10,12 +10,16 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/location.h"
#include "base/message_loop/message_loop.h"
+#include "chromeos/chromeos_switches.h"
namespace chromeos {
-FakeDebugDaemonClient::FakeDebugDaemonClient() {}
+FakeDebugDaemonClient::FakeDebugDaemonClient()
+ : featues_mask_(DebugDaemonClient::DEV_FEATURE_NONE) {
+}
FakeDebugDaemonClient::~FakeDebugDaemonClient() {}
@@ -120,4 +124,34 @@ void FakeDebugDaemonClient::TestICMPWithOptions(
void FakeDebugDaemonClient::UploadCrashes() {
}
+void FakeDebugDaemonClient::EnableDebuggingFeatures(
+ const std::string& password,
+ const DebugDaemonClient::EnableDebuggingCallback& callback) {
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, true));
+}
+
+void FakeDebugDaemonClient::SetDebuggingFeaturesStatus(int featues_mask) {
+ featues_mask_ = featues_mask;
+}
+
+void FakeDebugDaemonClient::QueryDebuggingFeatures(
+ const DebugDaemonClient::QueryDevFeaturesCallback& callback) {
+ bool supported = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kSystemDevMode);
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback,
+ true,
+ static_cast<int>(
+ supported ? featues_mask_ :
+ DebugDaemonClient::DEV_FEATURES_DISABLED)));
+}
+
+void FakeDebugDaemonClient::RemoveRootfsVerification(
+ const DebugDaemonClient::EnableDebuggingCallback& callback) {
+ base::MessageLoop::current()->PostTask(FROM_HERE,
+ base::Bind(callback, true));
+}
+
} // namespace chromeos