| 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/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 } |
| OLD | NEW |