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

Unified Diff: chromeos/dbus/fake_debug_daemon_client.cc

Issue 2232203003: Implement a dbus client for CupsTool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finish addressing comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/fake_debug_daemon_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chromeos/dbus/fake_debug_daemon_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698