| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/bluetooth_profile.h" | 5 #include "device/bluetooth/bluetooth_profile.h" |
| 6 | 6 |
| 7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
| 8 #include "base/sequenced_task_runner.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" |
| 8 #include "device/bluetooth/bluetooth_profile_chromeos.h" | 11 #include "device/bluetooth/bluetooth_profile_chromeos.h" |
| 12 #include "device/bluetooth/bluetooth_socket_thread.h" |
| 9 #elif defined(OS_MACOSX) | 13 #elif defined(OS_MACOSX) |
| 10 #include "base/mac/mac_util.h" | 14 #include "base/mac/mac_util.h" |
| 11 #elif defined(OS_WIN) | 15 #elif defined(OS_WIN) |
| 12 #include "device/bluetooth/bluetooth_profile_win.h" | 16 #include "device/bluetooth/bluetooth_profile_win.h" |
| 13 #endif | 17 #endif |
| 14 | 18 |
| 15 namespace device { | 19 namespace device { |
| 16 | 20 |
| 17 BluetoothProfile::Options::Options() | 21 BluetoothProfile::Options::Options() |
| 18 : channel(0), | 22 : channel(0), |
| (...skipping 23 matching lines...) Expand all Loading... |
| 42 BluetoothProfile* CreateBluetoothProfileMac( | 46 BluetoothProfile* CreateBluetoothProfileMac( |
| 43 const BluetoothUUID& uuid, | 47 const BluetoothUUID& uuid, |
| 44 const BluetoothProfile::Options& options); | 48 const BluetoothProfile::Options& options); |
| 45 | 49 |
| 46 // static | 50 // static |
| 47 void BluetoothProfile::Register(const BluetoothUUID& uuid, | 51 void BluetoothProfile::Register(const BluetoothUUID& uuid, |
| 48 const Options& options, | 52 const Options& options, |
| 49 const ProfileCallback& callback) { | 53 const ProfileCallback& callback) { |
| 50 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 51 chromeos::BluetoothProfileChromeOS* profile = NULL; | 55 chromeos::BluetoothProfileChromeOS* profile = NULL; |
| 52 profile = new chromeos::BluetoothProfileChromeOS(); | 56 profile = new chromeos::BluetoothProfileChromeOS( |
| 57 base::ThreadTaskRunnerHandle::Get(), |
| 58 device::BluetoothSocketThread::Get()); |
| 53 profile->Init(uuid, options, callback); | 59 profile->Init(uuid, options, callback); |
| 54 #elif defined(OS_MACOSX) | 60 #elif defined(OS_MACOSX) |
| 55 BluetoothProfile* profile = NULL; | 61 BluetoothProfile* profile = NULL; |
| 56 | 62 |
| 57 if (base::mac::IsOSLionOrLater()) | 63 if (base::mac::IsOSLionOrLater()) |
| 58 profile = CreateBluetoothProfileMac(uuid, options); | 64 profile = CreateBluetoothProfileMac(uuid, options); |
| 59 callback.Run(profile); | 65 callback.Run(profile); |
| 60 #elif defined(OS_WIN) | 66 #elif defined(OS_WIN) |
| 61 BluetoothProfileWin* profile = NULL; | 67 BluetoothProfileWin* profile = NULL; |
| 62 profile = new BluetoothProfileWin(); | 68 profile = new BluetoothProfileWin(); |
| 63 profile->Init(uuid, options, callback); | 69 profile->Init(uuid, options, callback); |
| 64 #else | 70 #else |
| 65 callback.Run(NULL); | 71 callback.Run(NULL); |
| 66 #endif | 72 #endif |
| 67 } | 73 } |
| 68 | 74 |
| 69 } // namespace device | 75 } // namespace device |
| OLD | NEW |