Index: chromeos/dbus/fake_cups_client.cc |
diff --git a/chromeos/dbus/fake_cups_client.cc b/chromeos/dbus/fake_cups_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..657d1f22f7262144a84e41228bfceab0dd0de1b2 |
--- /dev/null |
+++ b/chromeos/dbus/fake_cups_client.cc |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chromeos/dbus/fake_cups_client.h" |
+ |
+#include "base/bind.h" |
+#include "base/logging.h" |
+#include "base/stl_util.h" |
+#include "base/threading/thread_task_runner_handle.h" |
+ |
+namespace chromeos { |
+ |
+FakeCupsClient::FakeCupsClient() {} |
+ |
+FakeCupsClient::~FakeCupsClient() {} |
+ |
+void FakeCupsClient::AddPrinter(const std::string& name, |
+ const std::string& uri, |
+ const std::string& ppd_path, |
+ bool ipp_everywhere, |
+ const AddPrinterCallback& callback, |
+ const base::Closure& error_callback) { |
+ printers_.insert(name); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
+ base::Bind(callback, true)); |
+} |
+ |
+void FakeCupsClient::RemovePrinter(const std::string& name, |
+ const RemovePrinterCallback& 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)); |
+} |
+ |
+void FakeCupsClient::Init(dbus::Bus* bus) { |
+ VLOG(1) << "FakeCupsClient initialized"; |
+} |
+ |
+} // namespace chromeos |