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_MACOSX) | 7 #if defined(OS_MACOSX) |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #elif defined(OS_WIN) | |
10 #include "device/bluetooth/bluetooth_profile_win.h" | |
11 #endif | 9 #endif |
12 | 10 |
13 namespace device { | 11 namespace device { |
14 | 12 |
15 BluetoothProfile::Options::Options() | 13 BluetoothProfile::Options::Options() |
16 : channel(0), | 14 : channel(0), |
17 psm(0), | 15 psm(0), |
18 require_authentication(false), | 16 require_authentication(false), |
19 require_authorization(false), | 17 require_authorization(false), |
20 auto_connect(false), | 18 auto_connect(false), |
(...skipping 23 matching lines...) Expand all Loading... |
44 // static | 42 // static |
45 void BluetoothProfile::Register(const BluetoothUUID& uuid, | 43 void BluetoothProfile::Register(const BluetoothUUID& uuid, |
46 const Options& options, | 44 const Options& options, |
47 const ProfileCallback& callback) { | 45 const ProfileCallback& callback) { |
48 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
49 BluetoothProfile* profile = NULL; | 47 BluetoothProfile* profile = NULL; |
50 | 48 |
51 if (base::mac::IsOSLionOrLater()) | 49 if (base::mac::IsOSLionOrLater()) |
52 profile = CreateBluetoothProfileMac(uuid, options); | 50 profile = CreateBluetoothProfileMac(uuid, options); |
53 callback.Run(profile); | 51 callback.Run(profile); |
54 #elif defined(OS_WIN) | |
55 BluetoothProfileWin* profile = NULL; | |
56 profile = new BluetoothProfileWin(); | |
57 profile->Init(uuid, options, callback); | |
58 #else | 52 #else |
59 callback.Run(NULL); | 53 callback.Run(NULL); |
60 #endif | 54 #endif |
61 } | 55 } |
62 | 56 |
63 } // namespace device | 57 } // namespace device |
OLD | NEW |