Remove the locks in shared renderer state.
[chromium-blink-merge.git] / device / bluetooth / bluetooth_profile.cc
blob0d9a757297091d2ec186b9a067ef0cb3519d2f63
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"
12 #elif defined(OS_WIN)
13 #include "device/bluetooth/bluetooth_profile_win.h"
14 #endif
16 #include <string>
18 namespace device {
20 BluetoothProfile::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) {
30 BluetoothProfile::Options::~Options() {
35 BluetoothProfile::BluetoothProfile() {
39 BluetoothProfile::~BluetoothProfile() {
44 // static
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);
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
67 } // namespace device