| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/dbus/shill_profile_client.h" | 5 #include "chromeos/dbus/shill_profile_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, | 161 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, |
| 162 const std::string& entry_path, | 162 const std::string& entry_path, |
| 163 const base::Closure& callback, | 163 const base::Closure& callback, |
| 164 const ErrorCallback& error_callback) OVERRIDE { | 164 const ErrorCallback& error_callback) OVERRIDE { |
| 165 MessageLoop::current()->PostTask(FROM_HERE, callback); | 165 MessageLoop::current()->PostTask(FROM_HERE, callback); |
| 166 } | 166 } |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 void PassEmptyDictionaryValue( | 169 void PassEmptyDictionaryValue( |
| 170 const DictionaryValueCallbackWithoutStatus& callback) const { | 170 const DictionaryValueCallbackWithoutStatus& callback) const { |
| 171 base::DictionaryValue dictionary; | 171 scoped_ptr<base::DictionaryValue> empty(new base::DictionaryValue); |
| 172 callback.Run(dictionary); | 172 callback.Run(empty.Pass()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Note: This should remain the last member so it'll be destroyed and | 175 // Note: This should remain the last member so it'll be destroyed and |
| 176 // invalidate its weak pointers before any other members are destroyed. | 176 // invalidate its weak pointers before any other members are destroyed. |
| 177 base::WeakPtrFactory<ShillProfileClientStubImpl> weak_ptr_factory_; | 177 base::WeakPtrFactory<ShillProfileClientStubImpl> weak_ptr_factory_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(ShillProfileClientStubImpl); | 179 DISALLOW_COPY_AND_ASSIGN(ShillProfileClientStubImpl); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 } // namespace | 182 } // namespace |
| 183 | 183 |
| 184 ShillProfileClient::ShillProfileClient() {} | 184 ShillProfileClient::ShillProfileClient() {} |
| 185 | 185 |
| 186 ShillProfileClient::~ShillProfileClient() {} | 186 ShillProfileClient::~ShillProfileClient() {} |
| 187 | 187 |
| 188 // static | 188 // static |
| 189 ShillProfileClient* ShillProfileClient::Create( | 189 ShillProfileClient* ShillProfileClient::Create( |
| 190 DBusClientImplementationType type, | 190 DBusClientImplementationType type, |
| 191 dbus::Bus* bus) { | 191 dbus::Bus* bus) { |
| 192 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 192 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 193 return new ShillProfileClientImpl(bus); | 193 return new ShillProfileClientImpl(bus); |
| 194 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 194 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 195 return new ShillProfileClientStubImpl(); | 195 return new ShillProfileClientStubImpl(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace chromeos | 198 } // namespace chromeos |
| OLD | NEW |