| 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 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 browser_context(), | 476 browser_context(), |
| 477 extension_id(), | 477 extension_id(), |
| 478 uuid_)); | 478 uuid_)); |
| 479 GetEventRouter(browser_context()) | 479 GetEventRouter(browser_context()) |
| 480 ->AddProfile(uuid_, extension_id(), bluetooth_profile); | 480 ->AddProfile(uuid_, extension_id(), bluetooth_profile); |
| 481 SendResponse(true); | 481 SendResponse(true); |
| 482 } | 482 } |
| 483 | 483 |
| 484 BluetoothRemoveProfileFunction::~BluetoothRemoveProfileFunction() {} | 484 BluetoothRemoveProfileFunction::~BluetoothRemoveProfileFunction() {} |
| 485 | 485 |
| 486 bool BluetoothRemoveProfileFunction::RunImpl() { | 486 bool BluetoothRemoveProfileFunction::RunSync() { |
| 487 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 487 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 488 scoped_ptr<RemoveProfile::Params> params( | 488 scoped_ptr<RemoveProfile::Params> params( |
| 489 RemoveProfile::Params::Create(*args_)); | 489 RemoveProfile::Params::Create(*args_)); |
| 490 | 490 |
| 491 device::BluetoothUUID uuid(params->profile.uuid); | 491 device::BluetoothUUID uuid(params->profile.uuid); |
| 492 | 492 |
| 493 if (!uuid.IsValid()) { | 493 if (!uuid.IsValid()) { |
| 494 SetError(kInvalidUuid); | 494 SetError(kInvalidUuid); |
| 495 return false; | 495 return false; |
| 496 } | 496 } |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 adapter, | 853 adapter, |
| 854 extension_id(), | 854 extension_id(), |
| 855 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), | 855 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), |
| 856 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); | 856 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); |
| 857 | 857 |
| 858 return true; | 858 return true; |
| 859 } | 859 } |
| 860 | 860 |
| 861 } // namespace api | 861 } // namespace api |
| 862 } // namespace extensions | 862 } // namespace extensions |
| OLD | NEW |