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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h" | 10 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 SetError(kProfileAlreadyRegistered); | 187 SetError(kProfileAlreadyRegistered); |
188 SendResponse(false); | 188 SendResponse(false); |
189 return; | 189 return; |
190 } | 190 } |
191 | 191 |
192 bluetooth_profile->SetConnectionCallback( | 192 bluetooth_profile->SetConnectionCallback( |
193 base::Bind(&ExtensionBluetoothEventRouter::DispatchConnectionEvent, | 193 base::Bind(&ExtensionBluetoothEventRouter::DispatchConnectionEvent, |
194 base::Unretained(GetEventRouter(GetProfile())), | 194 base::Unretained(GetEventRouter(GetProfile())), |
195 extension_id(), | 195 extension_id(), |
196 uuid_)); | 196 uuid_)); |
197 GetEventRouter(GetProfile())->AddProfile(uuid_, bluetooth_profile); | 197 GetEventRouter(GetProfile())->AddProfile( |
| 198 uuid_, extension_id(), bluetooth_profile); |
198 SendResponse(true); | 199 SendResponse(true); |
199 } | 200 } |
200 | 201 |
201 bool BluetoothRemoveProfileFunction::RunImpl() { | 202 bool BluetoothRemoveProfileFunction::RunImpl() { |
202 scoped_ptr<RemoveProfile::Params> params( | 203 scoped_ptr<RemoveProfile::Params> params( |
203 RemoveProfile::Params::Create(*args_)); | 204 RemoveProfile::Params::Create(*args_)); |
204 | 205 |
205 if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) { | 206 if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) { |
206 SetError(kInvalidUuid); | 207 SetError(kInvalidUuid); |
207 return false; | 208 return false; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 adapter->StopDiscovering( | 665 adapter->StopDiscovering( |
665 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), | 666 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), |
666 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); | 667 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); |
667 } | 668 } |
668 | 669 |
669 return true; | 670 return true; |
670 } | 671 } |
671 | 672 |
672 } // namespace api | 673 } // namespace api |
673 } // namespace extensions | 674 } // namespace extensions |
OLD | NEW |