Index: chromeos/dbus/fake_debug_daemon_client.cc |
diff --git a/chromeos/dbus/fake_debug_daemon_client.cc b/chromeos/dbus/fake_debug_daemon_client.cc |
index 8ec6a8d24ef2e9164de903af406c6da03dae5370..a07b18e0cd9064393dd722e4561a2f97393cd938 100644 |
--- a/chromeos/dbus/fake_debug_daemon_client.cc |
+++ b/chromeos/dbus/fake_debug_daemon_client.cc |
@@ -15,6 +15,7 @@ |
#include "base/command_line.h" |
#include "base/location.h" |
#include "base/single_thread_task_runner.h" |
+#include "base/stl_util.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "chromeos/chromeos_switches.h" |
@@ -217,4 +218,28 @@ void FakeDebugDaemonClient::SetServiceIsAvailable(bool is_available) { |
callbacks[i].Run(is_available); |
} |
+void FakeDebugDaemonClient::CupsAddPrinter( |
+ const std::string& name, |
+ const std::string& uri, |
+ const std::string& ppd_path, |
+ bool ipp_everywhere, |
+ const DebugDaemonClient::CupsAddPrinterCallback& callback, |
+ const base::Closure& error_callback) { |
+ printers_.insert(name); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
+ base::Bind(callback, true)); |
+} |
+ |
+void FakeDebugDaemonClient::CupsRemovePrinter( |
+ const std::string& name, |
+ const DebugDaemonClient::CupsRemovePrinterCallback& callback, |
+ const base::Closure& error_callback) { |
+ const bool has_printer = base::ContainsKey(printers_, name); |
+ if (has_printer) |
+ printers_.erase(name); |
+ |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::Bind(callback, has_printer)); |
+} |
+ |
} // namespace chromeos |