| 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 // Implements the Chrome Extensions Cookies API. | 5 // Implements the Chrome Extensions Cookies API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" | 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 ->RegisterObserver(this, cookies::OnChanged::kEventName); | 572 ->RegisterObserver(this, cookies::OnChanged::kEventName); |
| 573 } | 573 } |
| 574 | 574 |
| 575 CookiesAPI::~CookiesAPI() { | 575 CookiesAPI::~CookiesAPI() { |
| 576 } | 576 } |
| 577 | 577 |
| 578 void CookiesAPI::Shutdown() { | 578 void CookiesAPI::Shutdown() { |
| 579 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 579 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 580 } | 580 } |
| 581 | 581 |
| 582 static base::LazyInstance<BrowserContextKeyedAPIFactory<CookiesAPI> > | 582 static base::LazyInstance< |
| 583 g_factory = LAZY_INSTANCE_INITIALIZER; | 583 BrowserContextKeyedAPIFactory<CookiesAPI>>::DestructorAtExit g_factory = |
| 584 LAZY_INSTANCE_INITIALIZER; |
| 584 | 585 |
| 585 // static | 586 // static |
| 586 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { | 587 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { |
| 587 return g_factory.Pointer(); | 588 return g_factory.Pointer(); |
| 588 } | 589 } |
| 589 | 590 |
| 590 void CookiesAPI::OnListenerAdded(const EventListenerInfo& details) { | 591 void CookiesAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 591 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); | 592 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); |
| 592 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 593 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 593 } | 594 } |
| 594 | 595 |
| 595 } // namespace extensions | 596 } // namespace extensions |
| OLD | NEW |