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/tabs/tabs_windows_api.h" | 5 #include "chrome/browser/extensions/api/tabs/tabs_windows_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" |
9 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" | 9 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 void TabsWindowsAPI::Shutdown() { | 73 void TabsWindowsAPI::Shutdown() { |
74 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 74 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
75 } | 75 } |
76 | 76 |
77 static base::LazyInstance<ProfileKeyedAPIFactory<TabsWindowsAPI> > | 77 static base::LazyInstance<ProfileKeyedAPIFactory<TabsWindowsAPI> > |
78 g_factory = LAZY_INSTANCE_INITIALIZER; | 78 g_factory = LAZY_INSTANCE_INITIALIZER; |
79 | 79 |
80 ProfileKeyedAPIFactory<TabsWindowsAPI>* TabsWindowsAPI::GetFactoryInstance() { | 80 ProfileKeyedAPIFactory<TabsWindowsAPI>* TabsWindowsAPI::GetFactoryInstance() { |
81 return &g_factory.Get(); | 81 return g_factory.Pointer(); |
82 } | 82 } |
83 | 83 |
84 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) { | 84 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) { |
85 // Initialize the event routers. | 85 // Initialize the event routers. |
86 tabs_event_router(); | 86 tabs_event_router(); |
87 windows_event_router(); | 87 windows_event_router(); |
88 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 88 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
89 } | 89 } |
90 | 90 |
91 } // namespace extensions | 91 } // namespace extensions |
OLD | NEW |