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

Side by Side Diff: chrome/browser/extensions/api/management/management_api.cc

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years 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/management/management_api.h" 5 #include "chrome/browser/extensions/api/management/management_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 details)->extension; 642 details)->extension;
643 } else { 643 } else {
644 extension = content::Details<const Extension>(details).ptr(); 644 extension = content::Details<const Extension>(details).ptr();
645 } 645 }
646 CHECK(extension); 646 CHECK(extension);
647 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo( 647 scoped_ptr<management::ExtensionInfo> info = CreateExtensionInfo(
648 *extension, ExtensionSystem::Get(profile)); 648 *extension, ExtensionSystem::Get(profile));
649 args->Append(info->ToValue().release()); 649 args->Append(info->ToValue().release());
650 } 650 }
651 651
652 scoped_ptr<extensions::Event> event(new extensions::Event(
653 event_name, args.Pass()));
652 extensions::ExtensionSystem::Get(profile)->event_router()-> 654 extensions::ExtensionSystem::Get(profile)->event_router()->
653 DispatchEventToRenderers(event_name, args.Pass(), NULL, GURL(), 655 BroadcastEvent(event.Pass());
654 extensions::EventFilteringInfo());
655 } 656 }
656 657
657 ExtensionManagementAPI::ExtensionManagementAPI(Profile* profile) 658 ExtensionManagementAPI::ExtensionManagementAPI(Profile* profile)
658 : profile_(profile) { 659 : profile_(profile) {
659 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( 660 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
660 this, events::kOnExtensionInstalled); 661 this, events::kOnExtensionInstalled);
661 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( 662 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
662 this, events::kOnExtensionUninstalled); 663 this, events::kOnExtensionUninstalled);
663 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( 664 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
664 this, events::kOnExtensionEnabled); 665 this, events::kOnExtensionEnabled);
665 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver( 666 ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
666 this, events::kOnExtensionDisabled); 667 this, events::kOnExtensionDisabled);
667 } 668 }
668 669
669 ExtensionManagementAPI::~ExtensionManagementAPI() { 670 ExtensionManagementAPI::~ExtensionManagementAPI() {
670 } 671 }
671 672
672 void ExtensionManagementAPI::Shutdown() { 673 void ExtensionManagementAPI::Shutdown() {
673 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 674 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
674 } 675 }
675 676
676 void ExtensionManagementAPI::OnListenerAdded( 677 void ExtensionManagementAPI::OnListenerAdded(
677 const extensions::EventListenerInfo& details) { 678 const extensions::EventListenerInfo& details) {
678 management_event_router_.reset(new ExtensionManagementEventRouter(profile_)); 679 management_event_router_.reset(new ExtensionManagementEventRouter(profile_));
679 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 680 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
680 } 681 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698