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

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

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Code review comments. Created 9 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 | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698