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

Unified Diff: ios/chrome/app/steps/launch_to_foreground.mm

Issue 2596653003: [ios] Removed CookieStoreIOS::SetCookiePolicy. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ios/chrome/app/steps/launch_to_foreground.h ('k') | ios/net/cookies/cookie_store_ios.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/steps/launch_to_foreground.mm
diff --git a/ios/chrome/app/steps/launch_to_foreground.mm b/ios/chrome/app/steps/launch_to_foreground.mm
index 9b9b357e5ddfeebb7a06beda509a4e8aacb5f10d..4ec0b58cbbf46dad11133d94a29f42d0ee49a265 100644
--- a/ios/chrome/app/steps/launch_to_foreground.mm
+++ b/ios/chrome/app/steps/launch_to_foreground.mm
@@ -13,7 +13,6 @@
#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/content_settings/host_content_settings_map_factory.h"
-#include "ios/net/cookies/cookie_store_ios.h"
#include "ios/web/public/web_capabilities.h"
#include "ios/web/public/web_thread.h"
@@ -37,57 +36,6 @@
@end
-@implementation BrowserStateInitializer
-
-- (BOOL)canRunInState:(ApplicationState*)state {
- return state.browserState && state.phase == APPLICATION_BACKGROUNDED;
-}
-
-- (void)runInState:(ApplicationState*)state {
- DCHECK(!state.browserState->IsOffTheRecord());
- [self setInitialCookiesPolicy:state.browserState];
-}
-
-// Copied verbatim from MainController.
-- (void)setInitialCookiesPolicy:(ios::ChromeBrowserState*)browserState {
- DCHECK(browserState);
- net::CookieStoreIOS::CookiePolicy policy = net::CookieStoreIOS::BLOCK;
-
- auto settingsFactory =
- ios::HostContentSettingsMapFactory::GetForBrowserState(browserState);
- DCHECK(settingsFactory);
- ContentSetting cookieSetting = settingsFactory->GetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_COOKIES, nullptr);
-
- if (!web::IsAcceptCookieControlSupported()) {
- // Override the Accept Cookie policy as ALLOW is the only policy
- // supported by //web.
- policy = net::CookieStoreIOS::ALLOW;
- if (cookieSetting == CONTENT_SETTING_BLOCK) {
- settingsFactory->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES,
- CONTENT_SETTING_ALLOW);
- }
- } else {
- switch (cookieSetting) {
- case CONTENT_SETTING_ALLOW:
- policy = net::CookieStoreIOS::ALLOW;
- break;
- case CONTENT_SETTING_BLOCK:
- policy = net::CookieStoreIOS::BLOCK;
- break;
- default:
- NOTREACHED() << "Unsupported cookie policy.";
- break;
- }
- }
-
- web::WebThread::PostTask(
- web::WebThread::IO, FROM_HERE,
- base::Bind(&net::CookieStoreIOS::SetCookiePolicy, policy));
-}
-
-@end
-
@implementation PrepareForUI
- (BOOL)canRunInState:(ApplicationState*)state {
« no previous file with comments | « ios/chrome/app/steps/launch_to_foreground.h ('k') | ios/net/cookies/cookie_store_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698