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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 } | 567 } |
568 | 568 |
569 CookiesAPI::~CookiesAPI() { | 569 CookiesAPI::~CookiesAPI() { |
570 } | 570 } |
571 | 571 |
572 void CookiesAPI::Shutdown() { | 572 void CookiesAPI::Shutdown() { |
573 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 573 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
574 this); | 574 this); |
575 } | 575 } |
576 | 576 |
577 static base::LazyInstance<ProfileKeyedAPIFactory<CookiesAPI> > | 577 static base::LazyInstance<BrowserContextKeyedAPIFactory<CookiesAPI> > |
578 g_factory = LAZY_INSTANCE_INITIALIZER; | 578 g_factory = LAZY_INSTANCE_INITIALIZER; |
579 | 579 |
580 // static | 580 // static |
581 ProfileKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { | 581 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { |
582 return g_factory.Pointer(); | 582 return g_factory.Pointer(); |
583 } | 583 } |
584 | 584 |
585 void CookiesAPI::OnListenerAdded( | 585 void CookiesAPI::OnListenerAdded( |
586 const extensions::EventListenerInfo& details) { | 586 const extensions::EventListenerInfo& details) { |
587 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); | 587 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); |
588 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 588 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
589 this); | 589 this); |
590 } | 590 } |
591 | 591 |
592 } // namespace extensions | 592 } // namespace extensions |
OLD | NEW |