| 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/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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 } | 721 } |
| 722 | 722 |
| 723 ManagementAPI::~ManagementAPI() { | 723 ManagementAPI::~ManagementAPI() { |
| 724 } | 724 } |
| 725 | 725 |
| 726 void ManagementAPI::Shutdown() { | 726 void ManagementAPI::Shutdown() { |
| 727 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 727 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
| 728 this); | 728 this); |
| 729 } | 729 } |
| 730 | 730 |
| 731 static base::LazyInstance<ProfileKeyedAPIFactory<ManagementAPI> > | 731 static base::LazyInstance<BrowserContextKeyedAPIFactory<ManagementAPI> > |
| 732 g_factory = LAZY_INSTANCE_INITIALIZER; | 732 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 733 | 733 |
| 734 // static | 734 // static |
| 735 ProfileKeyedAPIFactory<ManagementAPI>* ManagementAPI::GetFactoryInstance() { | 735 BrowserContextKeyedAPIFactory<ManagementAPI>* |
| 736 ManagementAPI::GetFactoryInstance() { |
| 736 return g_factory.Pointer(); | 737 return g_factory.Pointer(); |
| 737 } | 738 } |
| 738 | 739 |
| 739 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 740 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 740 management_event_router_.reset( | 741 management_event_router_.reset( |
| 741 new ManagementEventRouter(Profile::FromBrowserContext(browser_context_))); | 742 new ManagementEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 742 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 743 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
| 743 this); | 744 this); |
| 744 } | 745 } |
| 745 | 746 |
| 746 } // namespace extensions | 747 } // namespace extensions |
| OLD | NEW |