OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ |
6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/public/browser/resource_throttle.h" | 10 #include "content/public/browser/resource_throttle.h" |
11 | 11 |
12 class ManagedModeURLFilter; | 12 class ManagedModeURLFilter; |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class URLRequest; | 15 class URLRequest; |
16 } | 16 } |
17 | 17 |
18 namespace policy { | |
19 class URLBlacklist; | |
20 } | |
21 | |
22 class ManagedModeResourceThrottle : public content::ResourceThrottle { | 18 class ManagedModeResourceThrottle : public content::ResourceThrottle { |
23 public: | 19 public: |
24 ManagedModeResourceThrottle(const net::URLRequest* request, | 20 ManagedModeResourceThrottle(const net::URLRequest* request, |
25 int render_process_host_id, | 21 int render_process_host_id, |
26 int render_view_id, | 22 int render_view_id, |
27 bool is_main_frame); | 23 bool is_main_frame); |
28 virtual ~ManagedModeResourceThrottle(); | 24 virtual ~ManagedModeResourceThrottle(); |
29 | 25 |
26 // Adds/removes a temporary exception to filtering for a | |
27 // render_process_host_id and render_view_id pair to the preview map. | |
28 // Adding saves the last approved hostname in the map. | |
Pam (message me for reviews)
2012/12/06 15:11:56
I'm having trouble following these comments. I'm n
Sergiu
2013/01/04 15:44:07
Hopefully they're clearer now, the preview map is
| |
29 static void AddTemporaryException(int render_process_host_id, | |
30 int render_view_id, | |
31 const GURL& url); | |
32 static void RemoveTemporaryException(int render_process_host_id, | |
33 int render_view_id); | |
34 | |
30 // content::ResourceThrottle implementation: | 35 // content::ResourceThrottle implementation: |
31 virtual void WillStartRequest(bool* defer) OVERRIDE; | 36 virtual void WillStartRequest(bool* defer) OVERRIDE; |
32 | 37 |
38 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; | |
39 | |
33 private: | 40 private: |
41 void ShowInterstitialIfNeeded(bool is_redirect, | |
42 const GURL& url, | |
43 bool* defer); | |
34 void OnInterstitialResult(bool continue_request); | 44 void OnInterstitialResult(bool continue_request); |
35 | 45 |
36 base::WeakPtrFactory<ManagedModeResourceThrottle> weak_ptr_factory_; | 46 base::WeakPtrFactory<ManagedModeResourceThrottle> weak_ptr_factory_; |
37 const net::URLRequest* request_; | 47 const net::URLRequest* request_; |
38 int render_process_host_id_; | 48 int render_process_host_id_; |
39 int render_view_id_; | 49 int render_view_id_; |
40 bool is_main_frame_; | 50 bool is_main_frame_; |
51 bool after_interstitial_; | |
41 const ManagedModeURLFilter* url_filter_; | 52 const ManagedModeURLFilter* url_filter_; |
42 | 53 |
43 DISALLOW_COPY_AND_ASSIGN(ManagedModeResourceThrottle); | 54 DISALLOW_COPY_AND_ASSIGN(ManagedModeResourceThrottle); |
44 }; | 55 }; |
45 | 56 |
46 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | 57 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ |
OLD | NEW |