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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 10837294: Add bluetooth.getName API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 #include <errno.h> 8 #include <errno.h>
9 #endif 9 #endif
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool BluetoothIsPoweredFunction::RunImpl() { 81 bool BluetoothIsPoweredFunction::RunImpl() {
82 SetResult(Value::CreateBooleanValue(GetAdapter(profile())->IsPowered())); 82 SetResult(Value::CreateBooleanValue(GetAdapter(profile())->IsPowered()));
83 return true; 83 return true;
84 } 84 }
85 85
86 bool BluetoothGetAddressFunction::RunImpl() { 86 bool BluetoothGetAddressFunction::RunImpl() {
87 SetResult(Value::CreateStringValue(GetAdapter(profile())->address())); 87 SetResult(Value::CreateStringValue(GetAdapter(profile())->address()));
88 return true; 88 return true;
89 } 89 }
90 90
91 bool BluetoothGetNameFunction::RunImpl() {
Mihai Parparita -not on Chrome 2012/08/17 20:30:07 Does this need a stub implementation in the #else
bryeung 2012/08/20 23:13:19 Good catch! Done.
92 SetResult(Value::CreateStringValue(GetAdapter(profile())->name()));
93 return true;
94 }
95
91 BluetoothGetDevicesFunction::BluetoothGetDevicesFunction() 96 BluetoothGetDevicesFunction::BluetoothGetDevicesFunction()
92 : callbacks_pending_(0) {} 97 : callbacks_pending_(0) {}
93 98
94 void BluetoothGetDevicesFunction::AddDeviceIfTrueCallback( 99 void BluetoothGetDevicesFunction::AddDeviceIfTrueCallback(
95 ListValue* list, 100 ListValue* list,
96 const chromeos::BluetoothDevice* device, 101 const chromeos::BluetoothDevice* device,
97 bool shouldAdd) { 102 bool shouldAdd) {
98 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 103 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
99 104
100 if (shouldAdd) 105 if (shouldAdd)
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 #endif 593 #endif
589 594
590 BluetoothReadFunction::BluetoothReadFunction() {} 595 BluetoothReadFunction::BluetoothReadFunction() {}
591 BluetoothReadFunction::~BluetoothReadFunction() {} 596 BluetoothReadFunction::~BluetoothReadFunction() {}
592 597
593 BluetoothWriteFunction::BluetoothWriteFunction() {} 598 BluetoothWriteFunction::BluetoothWriteFunction() {}
594 BluetoothWriteFunction::~BluetoothWriteFunction() {} 599 BluetoothWriteFunction::~BluetoothWriteFunction() {}
595 600
596 } // namespace api 601 } // namespace api
597 } // namespace extensions 602 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698