Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: device/bluetooth/bluetooth_profile.cc

Issue 220323004: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialized |empty_device_| in BluetoothDeviceWinTest. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « device/bluetooth/bluetooth_profile.h ('k') | device/bluetooth/bluetooth_profile_chromeos.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 #include "device/bluetooth/bluetooth_profile_chromeos.h" 8 #include "device/bluetooth/bluetooth_profile_chromeos.h"
9 #elif defined(OS_MACOSX) 9 #elif defined(OS_MACOSX)
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
11 #include "device/bluetooth/bluetooth_profile_mac.h" 11 #include "device/bluetooth/bluetooth_profile_mac.h"
12 #elif defined(OS_WIN) 12 #elif defined(OS_WIN)
13 #include "device/bluetooth/bluetooth_profile_win.h" 13 #include "device/bluetooth/bluetooth_profile_win.h"
14 #endif 14 #endif
15 15
16 #include <string>
17
18 namespace device { 16 namespace device {
19 17
20 BluetoothProfile::Options::Options() 18 BluetoothProfile::Options::Options()
21 : channel(0), 19 : channel(0),
22 psm(0), 20 psm(0),
23 require_authentication(false), 21 require_authentication(false),
24 require_authorization(false), 22 require_authorization(false),
25 auto_connect(false), 23 auto_connect(false),
26 version(0), 24 version(0),
27 features(0) { 25 features(0) {
28 } 26 }
29 27
30 BluetoothProfile::Options::~Options() { 28 BluetoothProfile::Options::~Options() {
31 29
32 } 30 }
33 31
34 32
35 BluetoothProfile::BluetoothProfile() { 33 BluetoothProfile::BluetoothProfile() {
36 34
37 } 35 }
38 36
39 BluetoothProfile::~BluetoothProfile() { 37 BluetoothProfile::~BluetoothProfile() {
40 38
41 } 39 }
42 40
43 41
44 // static 42 // static
45 void BluetoothProfile::Register(const std::string& uuid, 43 void BluetoothProfile::Register(const BluetoothUUID& uuid,
46 const Options& options, 44 const Options& options,
47 const ProfileCallback& callback) { 45 const ProfileCallback& callback) {
48 #if defined(OS_CHROMEOS) 46 #if defined(OS_CHROMEOS)
49 chromeos::BluetoothProfileChromeOS* profile = NULL; 47 chromeos::BluetoothProfileChromeOS* profile = NULL;
50 profile = new chromeos::BluetoothProfileChromeOS(); 48 profile = new chromeos::BluetoothProfileChromeOS();
51 profile->Init(uuid, options, callback); 49 profile->Init(uuid, options, callback);
52 #elif defined(OS_MACOSX) 50 #elif defined(OS_MACOSX)
53 BluetoothProfile* profile = NULL; 51 BluetoothProfile* profile = NULL;
54 52
55 if (base::mac::IsOSLionOrLater()) 53 if (base::mac::IsOSLionOrLater())
56 profile = new BluetoothProfileMac(uuid, options.name); 54 profile = new BluetoothProfileMac(uuid, options.name);
57 callback.Run(profile); 55 callback.Run(profile);
58 #elif defined(OS_WIN) 56 #elif defined(OS_WIN)
59 BluetoothProfile* profile = NULL; 57 BluetoothProfile* profile = NULL;
60 profile = new BluetoothProfileWin(uuid, options.name); 58 profile = new BluetoothProfileWin(uuid, options.name);
61 callback.Run(profile); 59 callback.Run(profile);
62 #else 60 #else
63 callback.Run(NULL); 61 callback.Run(NULL);
64 #endif 62 #endif
65 } 63 }
66 64
67 } // namespace device 65 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_profile.h ('k') | device/bluetooth/bluetooth_profile_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698