Infobar material design refresh: bg color
[chromium-blink-merge.git] / ios / web / web_state / web_state_policy_decider.mm
blob5f41fb8d6130f84bfdf6f96a4f91fd88c47ac88e
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   web_state_->RemovePolicyDecider(this);
34   web_state_ = nullptr;
37 }  // namespace web