| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 api::sessions::OnChanged::kEventName); | 589 api::sessions::OnChanged::kEventName); |
| 590 } | 590 } |
| 591 | 591 |
| 592 SessionsAPI::~SessionsAPI() { | 592 SessionsAPI::~SessionsAPI() { |
| 593 } | 593 } |
| 594 | 594 |
| 595 void SessionsAPI::Shutdown() { | 595 void SessionsAPI::Shutdown() { |
| 596 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 596 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 597 } | 597 } |
| 598 | 598 |
| 599 static base::LazyInstance<BrowserContextKeyedAPIFactory<SessionsAPI> > | 599 static base::LazyInstance< |
| 600 g_factory = LAZY_INSTANCE_INITIALIZER; | 600 BrowserContextKeyedAPIFactory<SessionsAPI>>::DestructorAtExit g_factory = |
| 601 LAZY_INSTANCE_INITIALIZER; |
| 601 | 602 |
| 602 BrowserContextKeyedAPIFactory<SessionsAPI>* | 603 BrowserContextKeyedAPIFactory<SessionsAPI>* |
| 603 SessionsAPI::GetFactoryInstance() { | 604 SessionsAPI::GetFactoryInstance() { |
| 604 return g_factory.Pointer(); | 605 return g_factory.Pointer(); |
| 605 } | 606 } |
| 606 | 607 |
| 607 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { | 608 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 608 sessions_event_router_.reset( | 609 sessions_event_router_.reset( |
| 609 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); | 610 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 610 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 611 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 611 } | 612 } |
| 612 | 613 |
| 613 } // namespace extensions | 614 } // namespace extensions |
| OLD | NEW |