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

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

Issue 128523003: Unregister Bluetooth profile when the extension that added it is unloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style issue Created 6 years, 11 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 | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698