Add ICU message format support
[chromium-blink-merge.git] / ios / web / web_state / web_state_policy_decider.mm
blobf61501178a71374c879a3340116e19d5a1493b7a
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
3 // found in the LICENSE file.
5 #include "ios/web/public/web_state/web_state_policy_decider.h"
7 #import "ios/web/public/web_state/web_state.h"
8 #import "ios/web/web_state/web_state_impl.h"
10 namespace web {
12 WebStatePolicyDecider::WebStatePolicyDecider(WebState* web_state)
13     : web_state_(web_state) {
14   DCHECK(web_state_);
15   web_state_->AddPolicyDecider(this);
18 WebStatePolicyDecider::~WebStatePolicyDecider() {
19   if (web_state_) {
20     web_state_->RemovePolicyDecider(this);
21   }
24 bool WebStatePolicyDecider::ShouldAllowRequest(NSURLRequest* request) {
25   return true;
28 bool WebStatePolicyDecider::ShouldAllowResponse(NSURLResponse* response) {
29   return true;
32 void WebStatePolicyDecider::ResetWebState() {
33   // The policy decider is not removed from |web_state_| here as removing while
34   // iterating is not supported. |web_state_| will take care of removing its
35   // policy deciders when being destroyed.
36   web_state_ = nullptr;