blob: f72ee8b67e7a40572768bcf247cf1bf66f96d06f [file] [log] [blame]
Alex Deymo30534502015-07-20 15:06:33 -07001// Copyright 2015 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 "update_engine/shill_proxy.h"
6
7#include <chromeos/dbus/service_constants.h>
8
9#include "update_engine/dbus_proxies.h"
10
11using org::chromium::flimflam::ManagerProxy;
12using org::chromium::flimflam::ManagerProxyInterface;
13using org::chromium::flimflam::ServiceProxy;
14using org::chromium::flimflam::ServiceProxyInterface;
15
16namespace chromeos_update_engine {
17
18ShillProxy::ShillProxy(const scoped_refptr<dbus::Bus>& bus) : bus_(bus) {}
19
20bool ShillProxy::Init() {
21 manager_proxy_.reset(
22 new ManagerProxy(bus_,
23 shill::kFlimflamServiceName,
24 dbus::ObjectPath(shill::kFlimflamServicePath)));
25 return true;
26}
27
28ManagerProxyInterface* ShillProxy::GetManagerProxy() {
29 return manager_proxy_.get();
30}
31
32std::unique_ptr<ServiceProxyInterface> ShillProxy::GetServiceForPath(
33 const std::string& path) {
34 DCHECK(bus_.get());
35 return std::unique_ptr<ServiceProxyInterface>(new ServiceProxy(
36 bus_, shill::kFlimflamServiceName, dbus::ObjectPath(path)));
37}
38
39} // namespace chromeos_update_engine