OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/content_settings/cookie_settings.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 #include "content/browser/browser_thread.h" |
| 12 |
| 13 // static |
| 14 CookieSettings* CookieSettingsFactory::GetForProfile( |
| 15 Profile* profile) { |
| 16 return static_cast<CookieSettings*>( |
| 17 GetInstance()->GetServiceForProfile(profile, true)); |
| 18 } |
| 19 |
| 20 // static |
| 21 CookieSettingsFactory* CookieSettingsFactory::GetInstance() { |
| 22 return Singleton<CookieSettingsFactory>::get(); |
| 23 } |
| 24 |
| 25 CookieSettingsFactory::CookieSettingsFactory() |
| 26 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
| 27 } |
| 28 |
| 29 CookieSettingsFactory::~CookieSettingsFactory() { |
| 30 } |
| 31 |
| 32 ProfileKeyedService* CookieSettingsFactory::BuildServiceInstanceFor( |
| 33 Profile* profile) const { |
| 34 CookieSettings* cookie_settings = new CookieSettings( |
| 35 profile->GetHostContentSettingsMap(), |
| 36 profile->GetPrefs(), |
| 37 profile->IsOffTheRecord()); |
| 38 return cookie_settings; |
| 39 } |
| 40 |
| 41 bool CookieSettingsFactory::ServiceHasOwnInstanceInIncognito() { |
| 42 return true; |
| 43 } |
OLD | NEW |