| 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_manager_client.h" | 5 #include "chromeos/dbus/fake_shill_manager_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 void FakeShillManagerClient::NotifyObserversPropertyChanged( | 959 void FakeShillManagerClient::NotifyObserversPropertyChanged( |
| 960 const std::string& property) { | 960 const std::string& property) { |
| 961 VLOG(1) << "NotifyObserversPropertyChanged: " << property; | 961 VLOG(1) << "NotifyObserversPropertyChanged: " << property; |
| 962 base::Value* value = NULL; | 962 base::Value* value = NULL; |
| 963 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) { | 963 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) { |
| 964 LOG(ERROR) << "Notify for unknown property: " << property; | 964 LOG(ERROR) << "Notify for unknown property: " << property; |
| 965 return; | 965 return; |
| 966 } | 966 } |
| 967 if (property == shill::kServiceCompleteListProperty) { | 967 if (property == shill::kServiceCompleteListProperty) { |
| 968 std::unique_ptr<base::ListValue> services(GetEnabledServiceList(property)); | 968 std::unique_ptr<base::ListValue> services(GetEnabledServiceList(property)); |
| 969 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, | 969 for (auto& observer : observer_list_) |
| 970 observer_list_, | 970 observer.OnPropertyChanged(property, *(services.get())); |
| 971 OnPropertyChanged(property, *(services.get()))); | |
| 972 return; | 971 return; |
| 973 } | 972 } |
| 974 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, | 973 for (auto& observer : observer_list_) |
| 975 observer_list_, | 974 observer.OnPropertyChanged(property, *value); |
| 976 OnPropertyChanged(property, *value)); | |
| 977 } | 975 } |
| 978 | 976 |
| 979 base::ListValue* FakeShillManagerClient::GetListProperty( | 977 base::ListValue* FakeShillManagerClient::GetListProperty( |
| 980 const std::string& property) { | 978 const std::string& property) { |
| 981 base::ListValue* list_property = NULL; | 979 base::ListValue* list_property = NULL; |
| 982 if (!stub_properties_.GetListWithoutPathExpansion( | 980 if (!stub_properties_.GetListWithoutPathExpansion( |
| 983 property, &list_property)) { | 981 property, &list_property)) { |
| 984 list_property = new base::ListValue; | 982 list_property = new base::ListValue; |
| 985 stub_properties_.SetWithoutPathExpansion(property, list_property); | 983 stub_properties_.SetWithoutPathExpansion(property, list_property); |
| 986 } | 984 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 LOG(WARNING) << "Invalid state: " << state << " for " << type; | 1228 LOG(WARNING) << "Invalid state: " << state << " for " << type; |
| 1231 result = shill::kStateIdle; | 1229 result = shill::kStateIdle; |
| 1232 } | 1230 } |
| 1233 } | 1231 } |
| 1234 VLOG(1) << "Initial state for: " << type << " = " << result | 1232 VLOG(1) << "Initial state for: " << type << " = " << result |
| 1235 << " Enabled: " << *enabled; | 1233 << " Enabled: " << *enabled; |
| 1236 return result; | 1234 return result; |
| 1237 } | 1235 } |
| 1238 | 1236 |
| 1239 } // namespace chromeos | 1237 } // namespace chromeos |
| OLD | NEW |