| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bluetooth_adapter_client.h" | 5 #include "chromeos/dbus/bluetooth_adapter_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 virtual void GetAll() OVERRIDE { | 756 virtual void GetAll() OVERRIDE { |
| 757 VLOG(1) << "GetAll"; | 757 VLOG(1) << "GetAll"; |
| 758 } | 758 } |
| 759 | 759 |
| 760 virtual void Set(dbus::PropertyBase *property, | 760 virtual void Set(dbus::PropertyBase *property, |
| 761 dbus::PropertySet::SetCallback callback) OVERRIDE { | 761 dbus::PropertySet::SetCallback callback) OVERRIDE { |
| 762 VLOG(1) << "Set " << property->name(); | 762 VLOG(1) << "Set " << property->name(); |
| 763 if (property->name() == "Powered") { | 763 if (property->name() == "Powered") { |
| 764 property->ReplaceValueWithSetValue(); | 764 property->ReplaceValueWithSetValue(); |
| 765 NotifyPropertyChanged(property->name()); | |
| 766 callback.Run(true); | 765 callback.Run(true); |
| 767 } else { | 766 } else { |
| 768 callback.Run(false); | 767 callback.Run(false); |
| 769 } | 768 } |
| 770 } | 769 } |
| 771 }; | 770 }; |
| 772 | 771 |
| 773 BluetoothAdapterClientStubImpl() { | 772 BluetoothAdapterClientStubImpl() { |
| 774 properties_.reset(new Properties(base::Bind( | 773 properties_.reset(new Properties(base::Bind( |
| 775 &BluetoothAdapterClientStubImpl::OnPropertyChanged, | 774 &BluetoothAdapterClientStubImpl::OnPropertyChanged, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 DBusClientImplementationType type, | 921 DBusClientImplementationType type, |
| 923 dbus::Bus* bus, | 922 dbus::Bus* bus, |
| 924 BluetoothManagerClient* manager_client) { | 923 BluetoothManagerClient* manager_client) { |
| 925 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 924 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
| 926 return new BluetoothAdapterClientImpl(bus, manager_client); | 925 return new BluetoothAdapterClientImpl(bus, manager_client); |
| 927 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 926 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
| 928 return new BluetoothAdapterClientStubImpl(); | 927 return new BluetoothAdapterClientStubImpl(); |
| 929 } | 928 } |
| 930 | 929 |
| 931 } // namespace chromeos | 930 } // namespace chromeos |
| OLD | NEW |