blob: b70b3e67bbedba2d312d74991326f8b13b7ccf92 [file] [log] [blame]
Darin Petkov804e8d02012-10-10 16:44:36 +02001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/shims/task_proxy.h"
6
7#include <base/logging.h>
8
9using std::map;
10using std::string;
11
12namespace shill {
13
14namespace shims {
15
16TaskProxy::TaskProxy(DBus::Connection *connection,
17 const string &path,
18 const string &service)
19 : proxy_(connection, path, service) {}
20
21TaskProxy::~TaskProxy() {}
22
23void TaskProxy::Notify(const string &reason, map<string, string> &dict) {
24 LOG(INFO) << __func__ << "(" << reason << ", " << dict.size() << ")";
25 try {
26 proxy_.notify(reason, dict);
27 } catch (const DBus::Error &e) {
28 LOG(ERROR) << "DBus exception: " << e.name() << ": " << e.what();
29 }
30}
31
Darin Petkove6ca3202012-10-19 14:49:56 +020032bool TaskProxy::GetSecret(string *username, string *password) {
33 LOG(INFO) << __func__;
34 try {
35 proxy_.getsec(*username, *password);
36 } catch (const DBus::Error &e) {
37 LOG(ERROR) << "DBus exception: " << e.name() << ": " << e.what();
38 return false;
39 }
40 return true;
41}
42
Darin Petkov804e8d02012-10-10 16:44:36 +020043TaskProxy::Proxy::Proxy(DBus::Connection *connection,
44 const std::string &path,
45 const std::string &service)
46 : DBus::ObjectProxy(*connection, path, service.c_str()) {}
47
48TaskProxy::Proxy::~Proxy() {}
49
50} // namespace shims
51
52} // namespace shill