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 "device/bluetooth/bluez/bluetooth_device_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_device_bluez.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 weak_ptr_factory_.GetWeakPtr())); | 921 weak_ptr_factory_.GetWeakPtr())); |
922 } | 922 } |
923 | 923 |
924 void BluetoothDeviceBlueZ::OnSetTrusted(bool success) { | 924 void BluetoothDeviceBlueZ::OnSetTrusted(bool success) { |
925 LOG_IF(WARNING, !success) << object_path_.value() | 925 LOG_IF(WARNING, !success) << object_path_.value() |
926 << ": Failed to set device as trusted"; | 926 << ": Failed to set device as trusted"; |
927 } | 927 } |
928 | 928 |
929 void BluetoothDeviceBlueZ::OnDisconnect(const base::Closure& callback) { | 929 void BluetoothDeviceBlueZ::OnDisconnect(const base::Closure& callback) { |
930 VLOG(1) << object_path_.value() << ": Disconnected"; | 930 VLOG(1) << object_path_.value() << ": Disconnected"; |
931 // Do not notify about changed device since this is already done by | |
932 // the dbus::PropertySet and the property change callback for BlueZ. | |
933 DidDisconnectGatt(false /* notifyDeviceChanged */); | |
934 callback.Run(); | 931 callback.Run(); |
935 } | 932 } |
936 | 933 |
937 void BluetoothDeviceBlueZ::OnDisconnectError( | 934 void BluetoothDeviceBlueZ::OnDisconnectError( |
938 const ErrorCallback& error_callback, | 935 const ErrorCallback& error_callback, |
939 const std::string& error_name, | 936 const std::string& error_name, |
940 const std::string& error_message) { | 937 const std::string& error_message) { |
941 LOG(WARNING) << object_path_.value() | 938 LOG(WARNING) << object_path_.value() |
942 << ": Failed to disconnect device: " << error_name << ": " | 939 << ": Failed to disconnect device: " << error_name << ": " |
943 << error_message; | 940 << error_message; |
944 error_callback.Run(); | 941 error_callback.Run(); |
945 } | 942 } |
946 | 943 |
947 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, | 944 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, |
948 const std::string& error_name, | 945 const std::string& error_name, |
949 const std::string& error_message) { | 946 const std::string& error_message) { |
950 LOG(WARNING) << object_path_.value() | 947 LOG(WARNING) << object_path_.value() |
951 << ": Failed to remove device: " << error_name << ": " | 948 << ": Failed to remove device: " << error_name << ": " |
952 << error_message; | 949 << error_message; |
953 error_callback.Run(); | 950 error_callback.Run(); |
954 } | 951 } |
955 | 952 |
956 } // namespace bluez | 953 } // namespace bluez |
OLD | NEW |