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

Side by Side Diff: chrome/browser/background/background_contents_service_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 #include "chrome/browser/background/background_contents_service_factory.h" 5 #include "chrome/browser/background/background_contents_service_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/background/background_contents_service.h" 9 #include "chrome/browser/background/background_contents_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 16 matching lines...) Expand all
27 27
28 BackgroundContentsServiceFactory::BackgroundContentsServiceFactory() 28 BackgroundContentsServiceFactory::BackgroundContentsServiceFactory()
29 : ProfileKeyedServiceFactory("BackgroundContentsService", 29 : ProfileKeyedServiceFactory("BackgroundContentsService",
30 ProfileDependencyManager::GetInstance()) { 30 ProfileDependencyManager::GetInstance()) {
31 } 31 }
32 32
33 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { 33 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() {
34 } 34 }
35 35
36 ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor( 36 ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor(
37 Profile* profile) const { 37 content::BrowserContext* profile) const {
38 return new BackgroundContentsService(profile, 38 return new BackgroundContentsService(static_cast<Profile*>(profile),
39 CommandLine::ForCurrentProcess()); 39 CommandLine::ForCurrentProcess());
40 } 40 }
41 41
42 void BackgroundContentsServiceFactory::RegisterUserPrefs( 42 void BackgroundContentsServiceFactory::RegisterUserPrefs(
43 PrefRegistrySyncable* user_prefs) { 43 PrefRegistrySyncable* user_prefs) {
44 user_prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents, 44 user_prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents,
45 PrefRegistrySyncable::UNSYNCABLE_PREF); 45 PrefRegistrySyncable::UNSYNCABLE_PREF);
46 } 46 }
47 47
48 bool 48 bool
49 BackgroundContentsServiceFactory::ServiceHasOwnInstanceInIncognito() const { 49 BackgroundContentsServiceFactory::ServiceHasOwnInstanceInIncognito() const {
50 return true; 50 return true;
51 } 51 }
52 52
53 bool BackgroundContentsServiceFactory::ServiceIsCreatedWithProfile() const { 53 bool BackgroundContentsServiceFactory::ServiceIsCreatedWithProfile() const {
54 return true; 54 return true;
55 } 55 }
56 56
57 bool BackgroundContentsServiceFactory::ServiceIsNULLWhileTesting() const { 57 bool BackgroundContentsServiceFactory::ServiceIsNULLWhileTesting() const {
58 return true; 58 return true;
59 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698