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"
7 #if defined(OS_CHROMEOS)
8 #include "device/bluetooth/bluetooth_profile_chromeos.h"
9 #elif defined(OS_MACOSX)
10 #include "base/mac/mac_util.h"
11 #include "device/bluetooth/bluetooth_profile_mac.h"
13 #include "device/bluetooth/bluetooth_profile_win.h"
18 BluetoothProfile::Options::Options()
21 require_authentication(false),
22 require_authorization(false),
28 BluetoothProfile::Options::~Options() {
33 BluetoothProfile::BluetoothProfile() {
37 BluetoothProfile::~BluetoothProfile() {
43 void BluetoothProfile::Register(const BluetoothUUID
& uuid
,
44 const Options
& options
,
45 const ProfileCallback
& callback
) {
46 #if defined(OS_CHROMEOS)
47 chromeos::BluetoothProfileChromeOS
* profile
= NULL
;
48 profile
= new chromeos::BluetoothProfileChromeOS();
49 profile
->Init(uuid
, options
, callback
);
50 #elif defined(OS_MACOSX)
51 BluetoothProfile
* profile
= NULL
;
53 if (base::mac::IsOSLionOrLater())
54 profile
= new BluetoothProfileMac(uuid
, options
.name
);
55 callback
.Run(profile
);
57 BluetoothProfile
* profile
= NULL
;
58 profile
= new BluetoothProfileWin(uuid
, options
.name
);
59 callback
.Run(profile
);