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

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

Issue 14443003: D-Bus: notify properties changed from fakes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_adapter_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_adapter_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698