| Index: chromeos/dbus/debug_daemon_client.cc
|
| diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
|
| index d9d1d297417735e2d2199818507e4794c7299282..ed83a06bb46bb75156ff82794f26142e0dcd0887 100644
|
| --- a/chromeos/dbus/debug_daemon_client.cc
|
| +++ b/chromeos/dbus/debug_daemon_client.cc
|
| @@ -468,6 +468,41 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
|
| weak_ptr_factory_.GetWeakPtr(), callback));
|
| }
|
|
|
| + void 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) override {
|
| + dbus::MethodCall method_call(debugd::kDebugdInterface,
|
| + debugd::kCupsAddPrinter);
|
| + dbus::MessageWriter writer(&method_call);
|
| + writer.AppendString(name);
|
| + writer.AppendString(uri);
|
| + writer.AppendString(ppd_path);
|
| + writer.AppendBool(ipp_everywhere);
|
| +
|
| + debugdaemon_proxy_->CallMethod(
|
| + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| + base::Bind(&DebugDaemonClientImpl::OnPrinterAdded,
|
| + weak_ptr_factory_.GetWeakPtr(), callback, error_callback));
|
| + }
|
| +
|
| + void CupsRemovePrinter(
|
| + const std::string& name,
|
| + const DebugDaemonClient::CupsRemovePrinterCallback& callback,
|
| + const base::Closure& error_callback) override {
|
| + dbus::MethodCall method_call(debugd::kDebugdInterface,
|
| + debugd::kCupsRemovePrinter);
|
| + dbus::MessageWriter writer(&method_call);
|
| + writer.AppendString(name);
|
| +
|
| + debugdaemon_proxy_->CallMethod(
|
| + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| + base::Bind(&DebugDaemonClientImpl::OnPrinterRemoved,
|
| + weak_ptr_factory_.GetWeakPtr(), callback, error_callback));
|
| + }
|
| +
|
| protected:
|
| void Init(dbus::Bus* bus) override {
|
| debugdaemon_proxy_ =
|
| @@ -680,6 +715,30 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
|
| callback.Run(false, "");
|
| }
|
|
|
| + void OnPrinterAdded(const CupsAddPrinterCallback& callback,
|
| + const base::Closure& error_callback,
|
| + dbus::Response* response) {
|
| + bool result = false;
|
| + dbus::MessageReader reader(response);
|
| + if (response && reader.PopBool(&result)) {
|
| + callback.Run(result);
|
| + } else {
|
| + error_callback.Run();
|
| + }
|
| + }
|
| +
|
| + void OnPrinterRemoved(const CupsRemovePrinterCallback& callback,
|
| + const base::Closure& error_callback,
|
| + dbus::Response* response) {
|
| + bool result = false;
|
| + dbus::MessageReader reader(response);
|
| + if (response && reader.PopBool(&result)) {
|
| + callback.Run(result);
|
| + } else {
|
| + error_callback.Run();
|
| + }
|
| + }
|
| +
|
| dbus::ObjectProxy* debugdaemon_proxy_;
|
| std::unique_ptr<PipeReaderForString> pipe_reader_;
|
| StopAgentTracingCallback callback_;
|
|
|