| 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/content_settings/cookie_settings_factory.h" | 5 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // static | 21 // static |
| 22 scoped_refptr<content_settings::CookieSettings> | 22 scoped_refptr<content_settings::CookieSettings> |
| 23 CookieSettingsFactory::GetForProfile(Profile* profile) { | 23 CookieSettingsFactory::GetForProfile(Profile* profile) { |
| 24 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 24 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 25 return static_cast<content_settings::CookieSettings*>( | 25 return static_cast<content_settings::CookieSettings*>( |
| 26 GetInstance()->GetServiceForBrowserContext(profile, true).get()); | 26 GetInstance()->GetServiceForBrowserContext(profile, true).get()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 CookieSettingsFactory* CookieSettingsFactory::GetInstance() { | 30 CookieSettingsFactory* CookieSettingsFactory::GetInstance() { |
| 31 return Singleton<CookieSettingsFactory>::get(); | 31 return base::Singleton<CookieSettingsFactory>::get(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 CookieSettingsFactory::CookieSettingsFactory() | 34 CookieSettingsFactory::CookieSettingsFactory() |
| 35 : RefcountedBrowserContextKeyedServiceFactory( | 35 : RefcountedBrowserContextKeyedServiceFactory( |
| 36 "CookieSettings", | 36 "CookieSettings", |
| 37 BrowserContextDependencyManager::GetInstance()) { | 37 BrowserContextDependencyManager::GetInstance()) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 CookieSettingsFactory::~CookieSettingsFactory() { | 40 CookieSettingsFactory::~CookieSettingsFactory() { |
| 41 } | 41 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 59 if (profile->GetPrefs()->GetBoolean(prefs::kBlockThirdPartyCookies)) { | 59 if (profile->GetPrefs()->GetBoolean(prefs::kBlockThirdPartyCookies)) { |
| 60 content::RecordAction(UserMetricsAction("ThirdPartyCookieBlockingEnabled")); | 60 content::RecordAction(UserMetricsAction("ThirdPartyCookieBlockingEnabled")); |
| 61 } else { | 61 } else { |
| 62 content::RecordAction( | 62 content::RecordAction( |
| 63 UserMetricsAction("ThirdPartyCookieBlockingDisabled")); | 63 UserMetricsAction("ThirdPartyCookieBlockingDisabled")); |
| 64 } | 64 } |
| 65 return new content_settings::CookieSettings( | 65 return new content_settings::CookieSettings( |
| 66 profile->GetHostContentSettingsMap(), profile->GetPrefs(), | 66 profile->GetHostContentSettingsMap(), profile->GetPrefs(), |
| 67 extensions::kExtensionScheme); | 67 extensions::kExtensionScheme); |
| 68 } | 68 } |
| OLD | NEW |