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 #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/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { | 35 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { |
36 } | 36 } |
37 | 37 |
38 BrowserContextKeyedService* | 38 BrowserContextKeyedService* |
39 BackgroundContentsServiceFactory::BuildServiceInstanceFor( | 39 BackgroundContentsServiceFactory::BuildServiceInstanceFor( |
40 content::BrowserContext* profile) const { | 40 content::BrowserContext* profile) const { |
41 return new BackgroundContentsService(static_cast<Profile*>(profile), | 41 return new BackgroundContentsService(static_cast<Profile*>(profile), |
42 CommandLine::ForCurrentProcess()); | 42 CommandLine::ForCurrentProcess()); |
43 } | 43 } |
44 | 44 |
45 void BackgroundContentsServiceFactory::RegisterUserPrefs( | 45 void BackgroundContentsServiceFactory::RegisterProfilePrefs( |
46 user_prefs::PrefRegistrySyncable* user_prefs) { | 46 user_prefs::PrefRegistrySyncable* user_prefs) { |
47 user_prefs->RegisterDictionaryPref( | 47 user_prefs->RegisterDictionaryPref( |
48 prefs::kRegisteredBackgroundContents, | 48 prefs::kRegisteredBackgroundContents, |
49 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 49 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
50 } | 50 } |
51 | 51 |
52 content::BrowserContext* | 52 content::BrowserContext* |
53 BackgroundContentsServiceFactory::GetBrowserContextToUse( | 53 BackgroundContentsServiceFactory::GetBrowserContextToUse( |
54 content::BrowserContext* context) const { | 54 content::BrowserContext* context) const { |
55 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 55 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
56 } | 56 } |
57 | 57 |
58 bool | 58 bool |
59 BackgroundContentsServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 59 BackgroundContentsServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
60 return true; | 60 return true; |
61 } | 61 } |
62 | 62 |
63 bool BackgroundContentsServiceFactory::ServiceIsNULLWhileTesting() const { | 63 bool BackgroundContentsServiceFactory::ServiceIsNULLWhileTesting() const { |
64 return true; | 64 return true; |
65 } | 65 } |
OLD | NEW |