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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/cookie_settings_factory.cc
diff --git a/chrome/browser/content_settings/cookie_settings_factory.cc b/chrome/browser/content_settings/cookie_settings_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ac5e08059b3393db07cc7687b2d790995c47788d
--- /dev/null
+++ b/chrome/browser/content_settings/cookie_settings_factory.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/content_settings/cookie_settings_factory.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "content/browser/browser_thread.h"
+
+// static
+CookieSettings* CookieSettingsFactory::GetForProfile(
+ Profile* profile) {
+ return static_cast<CookieSettings*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+// static
+CookieSettingsFactory* CookieSettingsFactory::GetInstance() {
+ return Singleton<CookieSettingsFactory>::get();
+}
+
+CookieSettingsFactory::CookieSettingsFactory()
+ : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+}
+
+CookieSettingsFactory::~CookieSettingsFactory() {
+}
+
+ProfileKeyedService* CookieSettingsFactory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ CookieSettings* cookie_settings = new CookieSettings(
+ profile->GetHostContentSettingsMap(),
+ profile->GetPrefs(),
+ profile->IsOffTheRecord());
+ return cookie_settings;
+}
+
+bool CookieSettingsFactory::ServiceHasOwnInstanceInIncognito() {
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698