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
3 // found in the LICENSE file.
5 #include "device/bluetooth/bluetooth_profile.h"
8 #include "base/mac/mac_util.h"
10 #include "device/bluetooth/bluetooth_profile_win.h"
15 BluetoothProfile::Options::Options()
18 require_authentication(false),
19 require_authorization(false),
25 BluetoothProfile::Options::~Options() {
30 BluetoothProfile::BluetoothProfile() {
34 BluetoothProfile::~BluetoothProfile() {
37 // TODO(isherman): This is defined in BluetoothProfileMac.mm. Since the
38 // BluetoothProfile classes are soon going away, it's not really worth cleaning
40 BluetoothProfile
* CreateBluetoothProfileMac(
41 const BluetoothUUID
& uuid
,
42 const BluetoothProfile::Options
& options
);
45 void BluetoothProfile::Register(const BluetoothUUID
& uuid
,
46 const Options
& options
,
47 const ProfileCallback
& callback
) {
48 #if defined(OS_MACOSX)
49 BluetoothProfile
* profile
= NULL
;
51 if (base::mac::IsOSLionOrLater())
52 profile
= CreateBluetoothProfileMac(uuid
, options
);
53 callback
.Run(profile
);
55 BluetoothProfileWin
* profile
= NULL
;
56 profile
= new BluetoothProfileWin();
57 profile
->Init(uuid
, options
, callback
);