OLD | NEW |
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 Loading... |
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() { |
| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 bool BluetoothIsPoweredFunction::RunImpl() { | 519 bool BluetoothIsPoweredFunction::RunImpl() { |
515 NOTREACHED() << "Not implemented yet"; | 520 NOTREACHED() << "Not implemented yet"; |
516 return false; | 521 return false; |
517 } | 522 } |
518 | 523 |
519 bool BluetoothGetAddressFunction::RunImpl() { | 524 bool BluetoothGetAddressFunction::RunImpl() { |
520 NOTREACHED() << "Not implemented yet"; | 525 NOTREACHED() << "Not implemented yet"; |
521 return false; | 526 return false; |
522 } | 527 } |
523 | 528 |
| 529 bool BluetoothGetNameFunction::RunImpl() { |
| 530 NOTREACHED() << "Not implemented yet"; |
| 531 return false; |
| 532 } |
| 533 |
524 bool BluetoothGetDevicesFunction::RunImpl() { | 534 bool BluetoothGetDevicesFunction::RunImpl() { |
525 NOTREACHED() << "Not implemented yet"; | 535 NOTREACHED() << "Not implemented yet"; |
526 return false; | 536 return false; |
527 } | 537 } |
528 | 538 |
529 bool BluetoothGetServicesFunction::RunImpl() { | 539 bool BluetoothGetServicesFunction::RunImpl() { |
530 NOTREACHED() << "Not implemented yet"; | 540 NOTREACHED() << "Not implemented yet"; |
531 return false; | 541 return false; |
532 } | 542 } |
533 | 543 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 #endif | 598 #endif |
589 | 599 |
590 BluetoothReadFunction::BluetoothReadFunction() {} | 600 BluetoothReadFunction::BluetoothReadFunction() {} |
591 BluetoothReadFunction::~BluetoothReadFunction() {} | 601 BluetoothReadFunction::~BluetoothReadFunction() {} |
592 | 602 |
593 BluetoothWriteFunction::BluetoothWriteFunction() {} | 603 BluetoothWriteFunction::BluetoothWriteFunction() {} |
594 BluetoothWriteFunction::~BluetoothWriteFunction() {} | 604 BluetoothWriteFunction::~BluetoothWriteFunction() {} |
595 | 605 |
596 } // namespace api | 606 } // namespace api |
597 } // namespace extensions | 607 } // namespace extensions |
OLD | NEW |