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"
20 BluetoothProfile::Options::Options()
23 require_authentication(false),
24 require_authorization(false),
30 BluetoothProfile::Options::~Options() {
35 BluetoothProfile::BluetoothProfile() {
39 BluetoothProfile::~BluetoothProfile() {
45 void BluetoothProfile::Register(const std::string
& uuid
,
46 const Options
& options
,
47 const ProfileCallback
& callback
) {
48 #if defined(OS_CHROMEOS)
49 chromeos::BluetoothProfileChromeOS
* profile
= NULL
;
50 profile
= new chromeos::BluetoothProfileChromeOS();
51 profile
->Init(uuid
, options
, callback
);
52 #elif defined(OS_MACOSX)
53 BluetoothProfile
* profile
= NULL
;
55 if (base::mac::IsOSLionOrLater())
56 profile
= new BluetoothProfileMac(uuid
, options
.name
);
57 callback
.Run(profile
);
59 BluetoothProfile
* profile
= NULL
;
60 profile
= new BluetoothProfileWin(uuid
, options
.name
);
61 callback
.Run(profile
);