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

Side by Side Diff: chrome/browser/content_settings/cookie_settings_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
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/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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698