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.
4
5#include "device/bluetooth/bluetooth_profile.h"
6
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"
12#elif defined(OS_WIN)
13#include "device/bluetooth/bluetooth_profile_win.h"
14#endif
15
16#include <string>
17
18namespace device {
19
20BluetoothProfile::Options::Options()
21    : channel(0),
22      psm(0),
23      require_authentication(false),
24      require_authorization(false),
25      auto_connect(false),
26      version(0),
27      features(0) {
28}
29
30BluetoothProfile::Options::~Options() {
31
32}
33
34
35BluetoothProfile::BluetoothProfile() {
36
37}
38
39BluetoothProfile::~BluetoothProfile() {
40
41}
42
43
44// static
45void 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;
54
55  if (base::mac::IsOSLionOrLater())
56    profile = new BluetoothProfileMac(uuid, options.name);
57  callback.Run(profile);
58#elif defined(OS_WIN)
59  BluetoothProfile* profile = NULL;
60  profile = new BluetoothProfileWin(uuid, options.name);
61  callback.Run(profile);
62#else
63  callback.Run(NULL);
64#endif
65}
66
67}  // namespace device
68