| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_stub.h" | 5 #include "chromeos/dbus/shill_profile_client_stub.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 void PassDictionary( | 31 void PassDictionary( |
| 32 const ShillProfileClient::DictionaryValueCallbackWithoutStatus& callback, | 32 const ShillProfileClient::DictionaryValueCallbackWithoutStatus& callback, |
| 33 const base::DictionaryValue* dictionary) { | 33 const base::DictionaryValue* dictionary) { |
| 34 callback.Run(*dictionary); | 34 callback.Run(*dictionary); |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 // static | |
| 40 const char ShillProfileClientStub::kSharedProfilePath[] = "/profile/default"; | |
| 41 | |
| 42 ShillProfileClientStub::ShillProfileClientStub() { | 39 ShillProfileClientStub::ShillProfileClientStub() { |
| 43 } | 40 } |
| 44 | 41 |
| 45 ShillProfileClientStub::~ShillProfileClientStub() { | 42 ShillProfileClientStub::~ShillProfileClientStub() { |
| 46 STLDeleteValues(&profiles_); | 43 STLDeleteValues(&profiles_); |
| 47 } | 44 } |
| 48 | 45 |
| 49 void ShillProfileClientStub::Init(dbus::Bus* bus) { | 46 void ShillProfileClientStub::Init(dbus::Bus* bus) { |
| 50 AddProfile(kSharedProfilePath, std::string()); | |
| 51 } | 47 } |
| 52 | 48 |
| 53 void ShillProfileClientStub::AddPropertyChangedObserver( | 49 void ShillProfileClientStub::AddPropertyChangedObserver( |
| 54 const dbus::ObjectPath& profile_path, | 50 const dbus::ObjectPath& profile_path, |
| 55 ShillPropertyChangedObserver* observer) { | 51 ShillPropertyChangedObserver* observer) { |
| 56 } | 52 } |
| 57 | 53 |
| 58 void ShillProfileClientStub::RemovePropertyChangedObserver( | 54 void ShillProfileClientStub::RemovePropertyChangedObserver( |
| 59 const dbus::ObjectPath& profile_path, | 55 const dbus::ObjectPath& profile_path, |
| 60 ShillPropertyChangedObserver* observer) { | 56 ShillPropertyChangedObserver* observer) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (found == profiles_.end()) { | 199 if (found == profiles_.end()) { |
| 204 if (!error_callback.is_null()) | 200 if (!error_callback.is_null()) |
| 205 error_callback.Run("Error.InvalidProfile", "Invalid profile"); | 201 error_callback.Run("Error.InvalidProfile", "Invalid profile"); |
| 206 return NULL; | 202 return NULL; |
| 207 } | 203 } |
| 208 | 204 |
| 209 return found->second; | 205 return found->second; |
| 210 } | 206 } |
| 211 | 207 |
| 212 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |