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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs_windows_api.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months 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
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/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/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 WindowsEventRouter* TabsWindowsAPI::windows_event_router() { 63 WindowsEventRouter* TabsWindowsAPI::windows_event_router() {
64 return windows_event_router_.get(); 64 return windows_event_router_.get();
65 } 65 }
66 66
67 void TabsWindowsAPI::Shutdown() { 67 void TabsWindowsAPI::Shutdown() {
68 EventRouter::Get(browser_context_)->UnregisterObserver(this); 68 EventRouter::Get(browser_context_)->UnregisterObserver(this);
69 } 69 }
70 70
71 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabsWindowsAPI> > 71 static base::LazyInstance<
72 g_factory = LAZY_INSTANCE_INITIALIZER; 72 BrowserContextKeyedAPIFactory<TabsWindowsAPI>>::DestructorAtExit g_factory =
73 LAZY_INSTANCE_INITIALIZER;
73 74
74 BrowserContextKeyedAPIFactory<TabsWindowsAPI>* 75 BrowserContextKeyedAPIFactory<TabsWindowsAPI>*
75 TabsWindowsAPI::GetFactoryInstance() { 76 TabsWindowsAPI::GetFactoryInstance() {
76 return g_factory.Pointer(); 77 return g_factory.Pointer();
77 } 78 }
78 79
79 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) { 80 void TabsWindowsAPI::OnListenerAdded(const EventListenerInfo& details) {
80 // Initialize the event routers. 81 // Initialize the event routers.
81 tabs_event_router(); 82 tabs_event_router();
82 EventRouter::Get(browser_context_)->UnregisterObserver(this); 83 EventRouter::Get(browser_context_)->UnregisterObserver(this);
83 } 84 }
84 85
85 } // namespace extensions 86 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698