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

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/host_content_settings_map_factory.h" 5 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
6 6
7 #include "chrome/browser/profiles/off_the_record_profile_impl.h" 7 #include "chrome/browser/profiles/off_the_record_profile_impl.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "components/content_settings/core/browser/host_content_settings_map.h" 9 #include "components/content_settings/core/browser/host_content_settings_map.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 HostContentSettingsMap* HostContentSettingsMapFactory::GetForProfile( 43 HostContentSettingsMap* HostContentSettingsMapFactory::GetForProfile(
44 Profile* profile) { 44 Profile* profile) {
45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
46 46
47 return static_cast<HostContentSettingsMap*>( 47 return static_cast<HostContentSettingsMap*>(
48 GetInstance()->GetServiceForBrowserContext(profile, true).get()); 48 GetInstance()->GetServiceForBrowserContext(profile, true).get());
49 } 49 }
50 50
51 // static 51 // static
52 HostContentSettingsMapFactory* HostContentSettingsMapFactory::GetInstance() { 52 HostContentSettingsMapFactory* HostContentSettingsMapFactory::GetInstance() {
53 return Singleton<HostContentSettingsMapFactory>::get(); 53 return base::Singleton<HostContentSettingsMapFactory>::get();
54 } 54 }
55 55
56 scoped_refptr<RefcountedKeyedService> 56 scoped_refptr<RefcountedKeyedService>
57 HostContentSettingsMapFactory::BuildServiceInstanceFor( 57 HostContentSettingsMapFactory::BuildServiceInstanceFor(
58 content::BrowserContext* context) const { 58 content::BrowserContext* context) const {
59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
60 60
61 Profile* profile = static_cast<Profile*>(context); 61 Profile* profile = static_cast<Profile*>(context);
62 bool off_the_record = profile->GetProfileType() == Profile::INCOGNITO_PROFILE; 62 bool off_the_record = profile->GetProfileType() == Profile::INCOGNITO_PROFILE;
63 63
(...skipping 25 matching lines...) Expand all
89 } 89 }
90 #endif // defined(ENABLE_SUPERVISED_USERS) 90 #endif // defined(ENABLE_SUPERVISED_USERS)
91 91
92 return settings_map; 92 return settings_map;
93 } 93 }
94 94
95 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse( 95 content::BrowserContext* HostContentSettingsMapFactory::GetBrowserContextToUse(
96 content::BrowserContext* context) const { 96 content::BrowserContext* context) const {
97 return context; 97 return context;
98 } 98 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698