Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / chromeos / dbus / shill_profile_client_stub.cc
blob9b427bb4be508f39e0a0f5b56d6d12bd90cb627d
1 // Copyright (c) 2013 The Chromium 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.
5 #include "chromeos/dbus/shill_profile_client_stub.h"
7 #include "base/bind.h"
8 #include "base/message_loop.h"
9 #include "base/stl_util.h"
10 #include "base/values.h"
11 #include "chromeos/dbus/shill_property_changed_observer.h"
12 #include "dbus/bus.h"
13 #include "dbus/message.h"
14 #include "dbus/object_path.h"
15 #include "dbus/values_util.h"
16 #include "third_party/cros_system_api/dbus/service_constants.h"
18 namespace chromeos {
20 ShillProfileClientStub::ShillProfileClientStub() : weak_ptr_factory_(this) {
23 ShillProfileClientStub::~ShillProfileClientStub() {
26 void ShillProfileClientStub::AddPropertyChangedObserver(
27 const dbus::ObjectPath& profile_path,
28 ShillPropertyChangedObserver* observer) {
31 void ShillProfileClientStub::RemovePropertyChangedObserver(
32 const dbus::ObjectPath& profile_path,
33 ShillPropertyChangedObserver* observer) {
36 void ShillProfileClientStub::GetProperties(
37 const dbus::ObjectPath& profile_path,
38 const DictionaryValueCallbackWithoutStatus& callback,
39 const ErrorCallback& error_callback) {
40 if (callback.is_null())
41 return;
42 MessageLoop::current()->PostTask(
43 FROM_HERE,
44 base::Bind(&ShillProfileClientStub::PassEmptyDictionaryValue,
45 weak_ptr_factory_.GetWeakPtr(),
46 callback));
49 void ShillProfileClientStub::GetEntry(
50 const dbus::ObjectPath& profile_path,
51 const std::string& entry_path,
52 const DictionaryValueCallbackWithoutStatus& callback,
53 const ErrorCallback& error_callback) {
54 if (callback.is_null())
55 return;
56 MessageLoop::current()->PostTask(
57 FROM_HERE,
58 base::Bind(&ShillProfileClientStub::PassEmptyDictionaryValue,
59 weak_ptr_factory_.GetWeakPtr(),
60 callback));
63 void ShillProfileClientStub::DeleteEntry(const dbus::ObjectPath& profile_path,
64 const std::string& entry_path,
65 const base::Closure& callback,
66 const ErrorCallback& error_callback) {
67 if (callback.is_null())
68 return;
69 MessageLoop::current()->PostTask(FROM_HERE, callback);
72 void ShillProfileClientStub::PassEmptyDictionaryValue(
73 const DictionaryValueCallbackWithoutStatus& callback) const {
74 base::DictionaryValue dictionary;
75 callback.Run(dictionary);
78 } // namespace chromeos