| OLD | NEW |
| 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 "ios/chrome/browser/content_settings/cookie_settings_factory.h" | 5 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "components/content_settings/core/browser/cookie_settings.h" | 8 #include "components/content_settings/core/browser/cookie_settings.h" |
| 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 10 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" | 10 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" |
| 11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 11 #include "ios/chrome/browser/chrome_url_constants.h" | 12 #include "ios/chrome/browser/chrome_url_constants.h" |
| 12 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" | 13 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" |
| 13 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 14 | 14 |
| 15 namespace ios { | 15 namespace ios { |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 scoped_refptr<content_settings::CookieSettings> | 18 scoped_refptr<content_settings::CookieSettings> |
| 19 CookieSettingsFactory::GetForBrowserState( | 19 CookieSettingsFactory::GetForBrowserState( |
| 20 ios::ChromeBrowserState* browser_state) { | 20 ios::ChromeBrowserState* browser_state) { |
| 21 return static_cast<content_settings::CookieSettings*>( | 21 return static_cast<content_settings::CookieSettings*>( |
| 22 GetInstance()->GetServiceForBrowserState(browser_state, true).get()); | 22 GetInstance()->GetServiceForBrowserState(browser_state, true).get()); |
| 23 } | 23 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 CookieSettingsFactory::BuildServiceInstanceFor( | 53 CookieSettingsFactory::BuildServiceInstanceFor( |
| 54 web::BrowserState* context) const { | 54 web::BrowserState* context) const { |
| 55 ios::ChromeBrowserState* browser_state = | 55 ios::ChromeBrowserState* browser_state = |
| 56 ios::ChromeBrowserState::FromBrowserState(context); | 56 ios::ChromeBrowserState::FromBrowserState(context); |
| 57 return new content_settings::CookieSettings( | 57 return new content_settings::CookieSettings( |
| 58 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state), | 58 ios::HostContentSettingsMapFactory::GetForBrowserState(browser_state), |
| 59 browser_state->GetPrefs(), kDummyExtensionScheme); | 59 browser_state->GetPrefs(), kDummyExtensionScheme); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace ios | 62 } // namespace ios |
| OLD | NEW |