1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_RESOURCE_THROTTLE_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/supervised_user/supervised_users.h"
11 #include "content/public/browser/resource_throttle.h"
13 class SupervisedUserURLFilter
;
19 class SupervisedUserResourceThrottle
: public content::ResourceThrottle
{
21 SupervisedUserResourceThrottle(const net::URLRequest
* request
,
23 const SupervisedUserURLFilter
* url_filter
);
24 virtual ~SupervisedUserResourceThrottle();
26 // content::ResourceThrottle implementation:
27 virtual void WillStartRequest(bool* defer
) override
;
29 virtual void WillRedirectRequest(const GURL
& new_url
, bool* defer
) override
;
31 virtual const char* GetNameForLogging() const override
;
34 void ShowInterstitialIfNeeded(bool is_redirect
,
37 void OnInterstitialResult(bool continue_request
);
39 const net::URLRequest
* request_
;
41 const SupervisedUserURLFilter
* url_filter_
;
42 base::WeakPtrFactory
<SupervisedUserResourceThrottle
> weak_ptr_factory_
;
44 DISALLOW_COPY_AND_ASSIGN(SupervisedUserResourceThrottle
);
47 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_RESOURCE_THROTTLE_H_