OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_profile.h" | 5 #include "device/bluetooth/bluetooth_profile.h" |
6 | 6 |
7 #if defined(OS_MACOSX) | 7 #if defined(OS_CHROMEOS) |
8 #include "device/bluetooth/bluetooth_profile_experimental_chromeos.h" | |
9 #elif defined(OS_MACOSX) | |
8 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
9 #include "device/bluetooth/bluetooth_profile_mac.h" | 11 #include "device/bluetooth/bluetooth_profile_mac.h" |
10 #endif | 12 #endif |
11 | 13 |
12 #include <string> | 14 #include <string> |
13 | 15 |
14 namespace device { | 16 namespace device { |
15 | 17 |
16 BluetoothProfile::Options::Options() | 18 BluetoothProfile::Options::Options() |
17 : channel(0), | 19 : channel(0), |
(...skipping 16 matching lines...) Expand all Loading... | |
34 | 36 |
35 BluetoothProfile::~BluetoothProfile() { | 37 BluetoothProfile::~BluetoothProfile() { |
36 | 38 |
37 } | 39 } |
38 | 40 |
39 | 41 |
40 // static | 42 // static |
41 void BluetoothProfile::Register(const std::string& uuid, | 43 void BluetoothProfile::Register(const std::string& uuid, |
42 const Options& options, | 44 const Options& options, |
43 const ProfileCallback& callback) { | 45 const ProfileCallback& callback) { |
46 #if defined(OS_CHROMEOS) | |
47 chromeos::BluetoothProfileExperimentalChromeOS* profile = NULL; | |
48 profile = new chromeos::BluetoothProfileExperimentalChromeOS(); | |
49 profile->Init(uuid, options, callback); | |
50 #elif defined(OS_MACOSX) | |
44 BluetoothProfile* profile = NULL; | 51 BluetoothProfile* profile = NULL; |
45 | 52 |
46 #if defined(OS_MACOSX) | |
47 if (base::mac::IsOSLionOrLater()) | 53 if (base::mac::IsOSLionOrLater()) |
48 profile = new BluetoothProfileMac(uuid, options.name); | 54 profile = new BluetoothProfileMac(uuid, options.name); |
55 callback.Run(profile); | |
49 #endif | 56 #endif |
youngki
2013/04/25 14:34:34
We should run callback.Run(NULL) for #else.
keybuk
2013/04/25 17:16:41
Done.
| |
50 | |
51 callback.Run(profile); | |
52 } | 57 } |
53 | 58 |
54 } // namespace device | 59 } // namespace device |
OLD | NEW |