| 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 "extensions/browser/api/management/management_api.h" | 5 #include "extensions/browser/api/management/management_api.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 event_router->RegisterObserver(this, management::OnDisabled::kEventName); | 850 event_router->RegisterObserver(this, management::OnDisabled::kEventName); |
| 851 } | 851 } |
| 852 | 852 |
| 853 ManagementAPI::~ManagementAPI() { | 853 ManagementAPI::~ManagementAPI() { |
| 854 } | 854 } |
| 855 | 855 |
| 856 void ManagementAPI::Shutdown() { | 856 void ManagementAPI::Shutdown() { |
| 857 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 857 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 858 } | 858 } |
| 859 | 859 |
| 860 static base::LazyInstance<BrowserContextKeyedAPIFactory<ManagementAPI>> | 860 static base::LazyInstance< |
| 861 g_factory = LAZY_INSTANCE_INITIALIZER; | 861 BrowserContextKeyedAPIFactory<ManagementAPI>>::DestructorAtExit g_factory = |
| 862 LAZY_INSTANCE_INITIALIZER; |
| 862 | 863 |
| 863 // static | 864 // static |
| 864 BrowserContextKeyedAPIFactory<ManagementAPI>* | 865 BrowserContextKeyedAPIFactory<ManagementAPI>* |
| 865 ManagementAPI::GetFactoryInstance() { | 866 ManagementAPI::GetFactoryInstance() { |
| 866 return g_factory.Pointer(); | 867 return g_factory.Pointer(); |
| 867 } | 868 } |
| 868 | 869 |
| 869 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { | 870 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 870 management_event_router_.reset(new ManagementEventRouter(browser_context_)); | 871 management_event_router_.reset(new ManagementEventRouter(browser_context_)); |
| 871 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 872 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 872 } | 873 } |
| 873 | 874 |
| 874 } // namespace extensions | 875 } // namespace extensions |
| OLD | NEW |