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; |
+} |