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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 11682005: Remove some Profile-keyed factory boilerplate: management omnibox preference push_messaging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | Annotate | Revision Log
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 // 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 this, keys::kOnChanged); 549 this, keys::kOnChanged);
550 } 550 }
551 551
552 CookiesAPI::~CookiesAPI() { 552 CookiesAPI::~CookiesAPI() {
553 } 553 }
554 554
555 void CookiesAPI::Shutdown() { 555 void CookiesAPI::Shutdown() {
556 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 556 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
557 } 557 }
558 558
559 static base::LazyInstance<ProfileKeyedAPIFactory<CookiesAPI> >
560 g_factory = LAZY_INSTANCE_INITIALIZER;
561
562 // static
563 ProfileKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() {
564 return &g_factory.Get();
565 }
566
559 void CookiesAPI::OnListenerAdded( 567 void CookiesAPI::OnListenerAdded(
560 const extensions::EventListenerInfo& details) { 568 const extensions::EventListenerInfo& details) {
561 cookies_event_router_.reset(new CookiesEventRouter(profile_)); 569 cookies_event_router_.reset(new CookiesEventRouter(profile_));
562 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 570 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
563 } 571 }
564 572
565 static base::LazyInstance<ProfileKeyedAPIFactory<CookiesAPI> >
566 g_factory = LAZY_INSTANCE_INITIALIZER;
567
568 template <>
569 ProfileKeyedAPIFactory<CookiesAPI>*
570 ProfileKeyedAPIFactory<CookiesAPI>::GetInstance() {
571 return &g_factory.Get();
572 }
573
574 } // namespace extensions 573 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.h ('k') | chrome/browser/extensions/api/input_ime/input_ime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698