| 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/bluetooth_input_client.h" | 5 #include "chromeos/dbus/bluetooth_input_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // call. Informs observers. | 106 // call. Informs observers. |
| 107 void OnPropertyChanged(const dbus::ObjectPath& object_path, | 107 void OnPropertyChanged(const dbus::ObjectPath& object_path, |
| 108 const std::string& property_name) { | 108 const std::string& property_name) { |
| 109 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_, | 109 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_, |
| 110 InputPropertyChanged(object_path, property_name)); | 110 InputPropertyChanged(object_path, property_name)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 dbus::ObjectManager* object_manager_; | 113 dbus::ObjectManager* object_manager_; |
| 114 | 114 |
| 115 // List of observers interested in event notifications from us. | 115 // List of observers interested in event notifications from us. |
| 116 ObserverList<BluetoothInputClient::Observer> observers_; | 116 base::ObserverList<BluetoothInputClient::Observer> observers_; |
| 117 | 117 |
| 118 // Weak pointer factory for generating 'this' pointers that might live longer | 118 // Weak pointer factory for generating 'this' pointers that might live longer |
| 119 // than we do. | 119 // than we do. |
| 120 // Note: This should remain the last member so it'll be destroyed and | 120 // Note: This should remain the last member so it'll be destroyed and |
| 121 // invalidate its weak pointers before any other members are destroyed. | 121 // invalidate its weak pointers before any other members are destroyed. |
| 122 base::WeakPtrFactory<BluetoothInputClientImpl> weak_ptr_factory_; | 122 base::WeakPtrFactory<BluetoothInputClientImpl> weak_ptr_factory_; |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(BluetoothInputClientImpl); | 124 DISALLOW_COPY_AND_ASSIGN(BluetoothInputClientImpl); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 BluetoothInputClient::BluetoothInputClient() { | 127 BluetoothInputClient::BluetoothInputClient() { |
| 128 } | 128 } |
| 129 | 129 |
| 130 BluetoothInputClient::~BluetoothInputClient() { | 130 BluetoothInputClient::~BluetoothInputClient() { |
| 131 } | 131 } |
| 132 | 132 |
| 133 BluetoothInputClient* BluetoothInputClient::Create() { | 133 BluetoothInputClient* BluetoothInputClient::Create() { |
| 134 return new BluetoothInputClientImpl(); | 134 return new BluetoothInputClientImpl(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace chromeos | 137 } // namespace chromeos |
| OLD | NEW |