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

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

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time Created 6 years, 9 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_event_router.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 ExtensionBluetoothEventRouter::ExtensionBluetoothEventRouter( 46 ExtensionBluetoothEventRouter::ExtensionBluetoothEventRouter(
47 content::BrowserContext* context) 47 content::BrowserContext* context)
48 : browser_context_(context), 48 : browser_context_(context),
49 adapter_(NULL), 49 adapter_(NULL),
50 num_event_listeners_(0), 50 num_event_listeners_(0),
51 next_socket_id_(1), 51 next_socket_id_(1),
52 weak_ptr_factory_(this) { 52 weak_ptr_factory_(this) {
53 DCHECK(browser_context_); 53 DCHECK(browser_context_);
54 registrar_.Add(this, 54 registrar_.Add(this,
55 chrome::NOTIFICATION_EXTENSION_UNLOADED, 55 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
56 content::Source<content::BrowserContext>(browser_context_)); 56 content::Source<content::BrowserContext>(browser_context_));
57 } 57 }
58 58
59 ExtensionBluetoothEventRouter::~ExtensionBluetoothEventRouter() { 59 ExtensionBluetoothEventRouter::~ExtensionBluetoothEventRouter() {
60 if (adapter_.get()) { 60 if (adapter_.get()) {
61 adapter_->RemoveObserver(this); 61 adapter_->RemoveObserver(this);
62 adapter_ = NULL; 62 adapter_ = NULL;
63 } 63 }
64 DLOG_IF(WARNING, socket_map_.size() != 0) 64 DLOG_IF(WARNING, socket_map_.size() != 0)
65 << "Bluetooth sockets are still open."; 65 << "Bluetooth sockets are still open.";
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 delete iter->second; 402 delete iter->second;
403 discovery_session_map_[extension_id] = discovery_session.release(); 403 discovery_session_map_[extension_id] = discovery_session.release();
404 callback.Run(); 404 callback.Run();
405 } 405 }
406 406
407 void ExtensionBluetoothEventRouter::Observe( 407 void ExtensionBluetoothEventRouter::Observe(
408 int type, 408 int type,
409 const content::NotificationSource& source, 409 const content::NotificationSource& source,
410 const content::NotificationDetails& details) { 410 const content::NotificationDetails& details) {
411 switch (type) { 411 switch (type) {
412 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { 412 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
413 extensions::UnloadedExtensionInfo* info = 413 extensions::UnloadedExtensionInfo* info =
414 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); 414 content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
415 CleanUpForExtension(info->extension->id()); 415 CleanUpForExtension(info->extension->id());
416 break; 416 break;
417 } 417 }
418 } 418 }
419 } 419 }
420 420
421 } // namespace extensions 421 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698