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/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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 void FakeShillProfileClient::AddEntry(const std::string& profile_path, | 140 void FakeShillProfileClient::AddEntry(const std::string& profile_path, |
141 const std::string& entry_path, | 141 const std::string& entry_path, |
142 const base::DictionaryValue& properties) { | 142 const base::DictionaryValue& properties) { |
143 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), | 143 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), |
144 ErrorCallback()); | 144 ErrorCallback()); |
145 DCHECK(profile); | 145 DCHECK(profile); |
146 profile->entries.SetWithoutPathExpansion(entry_path, properties.DeepCopy()); | 146 profile->entries.SetWithoutPathExpansion(entry_path, properties.DeepCopy()); |
147 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 147 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
148 AddManagerService(entry_path); | 148 AddManagerService(entry_path, true); |
149 } | 149 } |
150 | 150 |
151 bool FakeShillProfileClient::AddService(const std::string& profile_path, | 151 bool FakeShillProfileClient::AddService(const std::string& profile_path, |
152 const std::string& service_path) { | 152 const std::string& service_path) { |
153 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), | 153 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), |
154 ErrorCallback()); | 154 ErrorCallback()); |
155 if (!profile) { | 155 if (!profile) { |
156 LOG(ERROR) << "AddService: No matching profile: " << profile_path | 156 LOG(ERROR) << "AddService: No matching profile: " << profile_path |
157 << " for: " << service_path; | 157 << " for: " << service_path; |
158 return false; | 158 return false; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 if (found == profiles_.end()) { | 248 if (found == profiles_.end()) { |
249 if (!error_callback.is_null()) | 249 if (!error_callback.is_null()) |
250 error_callback.Run("Error.InvalidProfile", "Invalid profile"); | 250 error_callback.Run("Error.InvalidProfile", "Invalid profile"); |
251 return NULL; | 251 return NULL; |
252 } | 252 } |
253 | 253 |
254 return found->second; | 254 return found->second; |
255 } | 255 } |
256 | 256 |
257 } // namespace chromeos | 257 } // namespace chromeos |
OLD | NEW |