OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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. | |
4 | |
5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | |
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "chrome/browser/managed_mode/managed_users.h" | |
11 #include "content/public/browser/resource_throttle.h" | |
12 | |
13 class ManagedModeURLFilter; | |
14 | |
15 namespace net { | |
16 class URLRequest; | |
17 } | |
18 | |
19 class ManagedModeResourceThrottle : public content::ResourceThrottle { | |
20 public: | |
21 ManagedModeResourceThrottle(const net::URLRequest* request, | |
22 bool is_main_frame, | |
23 const ManagedModeURLFilter* url_filter); | |
24 virtual ~ManagedModeResourceThrottle(); | |
25 | |
26 // content::ResourceThrottle implementation: | |
27 virtual void WillStartRequest(bool* defer) OVERRIDE; | |
28 | |
29 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; | |
30 | |
31 virtual const char* GetNameForLogging() const OVERRIDE; | |
32 | |
33 private: | |
34 void ShowInterstitialIfNeeded(bool is_redirect, | |
35 const GURL& url, | |
36 bool* defer); | |
37 void OnInterstitialResult(bool continue_request); | |
38 | |
39 const net::URLRequest* request_; | |
40 bool is_main_frame_; | |
41 const ManagedModeURLFilter* url_filter_; | |
42 base::WeakPtrFactory<ManagedModeResourceThrottle> weak_ptr_factory_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(ManagedModeResourceThrottle); | |
45 }; | |
46 | |
47 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | |
OLD | NEW |