| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/fake_shill_profile_client.h" | 5 #include "chromeos/dbus/fake_shill_profile_client.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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 const base::DictionaryValue* dictionary) { | 34 const base::DictionaryValue* dictionary) { |
| 35 callback.Run(*dictionary); | 35 callback.Run(*dictionary); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 FakeShillProfileClient::FakeShillProfileClient() { | 40 FakeShillProfileClient::FakeShillProfileClient() { |
| 41 } | 41 } |
| 42 | 42 |
| 43 FakeShillProfileClient::~FakeShillProfileClient() { | 43 FakeShillProfileClient::~FakeShillProfileClient() { |
| 44 STLDeleteValues(&profiles_); | 44 base::STLDeleteValues(&profiles_); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void FakeShillProfileClient::Init(dbus::Bus* bus) { | 47 void FakeShillProfileClient::Init(dbus::Bus* bus) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 void FakeShillProfileClient::AddPropertyChangedObserver( | 50 void FakeShillProfileClient::AddPropertyChangedObserver( |
| 51 const dbus::ObjectPath& profile_path, | 51 const dbus::ObjectPath& profile_path, |
| 52 ShillPropertyChangedObserver* observer) { | 52 ShillPropertyChangedObserver* observer) { |
| 53 } | 53 } |
| 54 | 54 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 continue; | 233 continue; |
| 234 } | 234 } |
| 235 *profile_path = iter->first; | 235 *profile_path = iter->first; |
| 236 properties->MergeDictionary(entry); | 236 properties->MergeDictionary(entry); |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 return false; | 239 return false; |
| 240 } | 240 } |
| 241 | 241 |
| 242 void FakeShillProfileClient::ClearProfiles() { | 242 void FakeShillProfileClient::ClearProfiles() { |
| 243 STLDeleteValues(&profiles_); | 243 base::STLDeleteValues(&profiles_); |
| 244 } | 244 } |
| 245 | 245 |
| 246 FakeShillProfileClient::ProfileProperties* FakeShillProfileClient::GetProfile( | 246 FakeShillProfileClient::ProfileProperties* FakeShillProfileClient::GetProfile( |
| 247 const dbus::ObjectPath& profile_path, | 247 const dbus::ObjectPath& profile_path, |
| 248 const ErrorCallback& error_callback) { | 248 const ErrorCallback& error_callback) { |
| 249 ProfileMap::const_iterator found = profiles_.find(profile_path.value()); | 249 ProfileMap::const_iterator found = profiles_.find(profile_path.value()); |
| 250 if (found == profiles_.end()) { | 250 if (found == profiles_.end()) { |
| 251 if (!error_callback.is_null()) | 251 if (!error_callback.is_null()) |
| 252 error_callback.Run("Error.InvalidProfile", "Invalid profile"); | 252 error_callback.Run("Error.InvalidProfile", "Invalid profile"); |
| 253 return NULL; | 253 return NULL; |
| 254 } | 254 } |
| 255 | 255 |
| 256 return found->second; | 256 return found->second; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace chromeos | 259 } // namespace chromeos |
| OLD | NEW |