| 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 #elif defined(OS_WIN) | 12 #elif defined(OS_WIN) |
| 11 #include "device/bluetooth/bluetooth_profile_win.h" | 13 #include "device/bluetooth/bluetooth_profile_win.h" |
| 12 #endif | 14 #endif |
| 13 | 15 |
| 14 #include <string> | 16 #include <string> |
| 15 | 17 |
| 16 namespace device { | 18 namespace device { |
| 17 | 19 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 BluetoothProfile::~BluetoothProfile() { | 39 BluetoothProfile::~BluetoothProfile() { |
| 38 | 40 |
| 39 } | 41 } |
| 40 | 42 |
| 41 | 43 |
| 42 // static | 44 // static |
| 43 void BluetoothProfile::Register(const std::string& uuid, | 45 void BluetoothProfile::Register(const std::string& uuid, |
| 44 const Options& options, | 46 const Options& options, |
| 45 const ProfileCallback& callback) { | 47 const ProfileCallback& callback) { |
| 48 #if defined(OS_CHROMEOS) |
| 49 chromeos::BluetoothProfileExperimentalChromeOS* profile = NULL; |
| 50 profile = new chromeos::BluetoothProfileExperimentalChromeOS(); |
| 51 profile->Init(uuid, options, callback); |
| 52 #elif defined(OS_MACOSX) |
| 46 BluetoothProfile* profile = NULL; | 53 BluetoothProfile* profile = NULL; |
| 47 | 54 |
| 48 #if defined(OS_MACOSX) | |
| 49 if (base::mac::IsOSLionOrLater()) | 55 if (base::mac::IsOSLionOrLater()) |
| 50 profile = new BluetoothProfileMac(uuid, options.name); | 56 profile = new BluetoothProfileMac(uuid, options.name); |
| 57 callback.Run(profile); |
| 51 #elif defined(OS_WIN) | 58 #elif defined(OS_WIN) |
| 59 BluetoothProfile* profile = NULL; |
| 52 profile = new BluetoothProfileWin(uuid, options.name); | 60 profile = new BluetoothProfileWin(uuid, options.name); |
| 61 callback.Run(profile); |
| 62 #else |
| 63 callback.Run(NULL); |
| 53 #endif | 64 #endif |
| 54 | |
| 55 callback.Run(profile); | |
| 56 } | 65 } |
| 57 | 66 |
| 58 } // namespace device | 67 } // namespace device |
| OLD | NEW |