| 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 "base/profiler/scoped_profile.h" | |
| 9 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" | 8 #include "chrome/browser/extensions/api/tabs/tabs_event_router.h" |
| 10 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" | 9 #include "chrome/browser/extensions/api/tabs/windows_event_router.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/extensions/api/tabs.h" | 11 #include "chrome/common/extensions/api/tabs.h" |
| 13 #include "chrome/common/extensions/api/windows.h" | 12 #include "chrome/common/extensions/api/windows.h" |
| 14 #include "extensions/browser/event_router.h" | 13 #include "extensions/browser/event_router.h" |
| 15 #include "extensions/browser/extension_system.h" | 14 #include "extensions/browser/extension_system.h" |
| 16 | 15 |
| 17 namespace extensions { | 16 namespace extensions { |
| 18 | 17 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 71 |
| 73 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabsWindowsAPI> > | 72 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabsWindowsAPI> > |
| 74 g_factory = LAZY_INSTANCE_INITIALIZER; | 73 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 75 | 74 |
| 76 BrowserContextKeyedAPIFactory<TabsWindowsAPI>* | 75 BrowserContextKeyedAPIFactory<TabsWindowsAPI>* |
| 77 TabsWindowsAPI::GetFactoryInstance() { | 76 TabsWindowsAPI::GetFactoryInstance() { |
| 78 return g_factory.Pointer(); | 77 return g_factory.Pointer(); |
| 79 } | 78 } |
| 80 | 79 |
| 81 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) { | 80 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 82 // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed. | |
| 83 tracked_objects::ScopedProfile tracking_profile( | |
| 84 FROM_HERE_WITH_EXPLICIT_FUNCTION("TabsWindowsAPI::OnListenerAdded")); | |
| 85 | |
| 86 // Initialize the event routers. | 81 // Initialize the event routers. |
| 87 tabs_event_router(); | 82 tabs_event_router(); |
| 88 windows_event_router(); | 83 windows_event_router(); |
| 89 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 84 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 90 } | 85 } |
| 91 | 86 |
| 92 } // namespace extensions | 87 } // namespace extensions |
| OLD | NEW |