Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: chromeos/dbus/fake_shill_device_client.cc

Issue 1059033002: Implement networkingPrivate.getDeviceStates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_device_client.h" 5 #include "chromeos/dbus/fake_shill_device_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 ClearDevices(); 395 ClearDevices();
396 396
397 stub_devices_.Clear(); 397 stub_devices_.Clear();
398 } 398 }
399 399
400 void FakeShillDeviceClient::SetDeviceProperty(const std::string& device_path, 400 void FakeShillDeviceClient::SetDeviceProperty(const std::string& device_path,
401 const std::string& name, 401 const std::string& name,
402 const base::Value& value) { 402 const base::Value& value) {
403 VLOG(1) << "SetDeviceProperty: " << device_path 403 VLOG(1) << "SetDeviceProperty: " << device_path
404 << ": " << name << " = " << value; 404 << ": " << name << " = " << value;
405 SetProperty(dbus::ObjectPath(device_path), name, value, 405 SetPropertyInternal(dbus::ObjectPath(device_path), name, value,
406 base::Bind(&base::DoNothing), 406 base::Bind(&base::DoNothing),
407 base::Bind(&ErrorFunction, device_path)); 407 base::Bind(&ErrorFunction, device_path));
408 } 408 }
409 409
410 std::string FakeShillDeviceClient::GetDevicePathForType( 410 std::string FakeShillDeviceClient::GetDevicePathForType(
411 const std::string& type) { 411 const std::string& type) {
412 for (base::DictionaryValue::Iterator iter(stub_devices_); 412 for (base::DictionaryValue::Iterator iter(stub_devices_);
413 !iter.IsAtEnd(); iter.Advance()) { 413 !iter.IsAtEnd(); iter.Advance()) {
414 const base::DictionaryValue* properties = NULL; 414 const base::DictionaryValue* properties = NULL;
415 if (!iter.value().GetAsDictionary(&properties)) 415 if (!iter.value().GetAsDictionary(&properties))
416 continue; 416 continue;
417 std::string prop_type; 417 std::string prop_type;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = 489 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter =
490 observer_list_.find(device_path); 490 observer_list_.find(device_path);
491 if (iter != observer_list_.end()) 491 if (iter != observer_list_.end())
492 return *(iter->second); 492 return *(iter->second);
493 PropertyObserverList* observer_list = new PropertyObserverList(); 493 PropertyObserverList* observer_list = new PropertyObserverList();
494 observer_list_[device_path] = observer_list; 494 observer_list_[device_path] = observer_list;
495 return *observer_list; 495 return *observer_list;
496 } 496 }
497 497
498 } // namespace chromeos 498 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698