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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual ~ManagedModeResourceThrottle(); | 25 virtual ~ManagedModeResourceThrottle(); |
26 | 26 |
27 // Adds/removes a temporary exception to filtering for a | 27 // Adds/removes a temporary exception to filtering for a |
28 // render_process_host_id and render_view_id pair (which identify a tab) | 28 // render_process_host_id and render_view_id pair (which identify a tab) |
29 // to the preview map. Adding saves the last approved hostname in the map, | 29 // to the preview map. Adding saves the last approved hostname in the map, |
30 // which is then used to allow the user to browse on that hostname without | 30 // which is then used to allow the user to browse on that hostname without |
31 // getting an interstitial. See managed_mode_resource_throttle.cc for more | 31 // getting an interstitial. See managed_mode_resource_throttle.cc for more |
32 // details on the preview map. | 32 // details on the preview map. |
33 static void AddTemporaryException(int render_process_host_id, | 33 static void AddTemporaryException(int render_process_host_id, |
34 int render_view_id, | 34 int render_view_id, |
35 const GURL& url, | 35 const GURL& url); |
36 bool new_navigation); | |
37 static void UpdateExceptionNavigationStatus(int render_process_host_id, | |
38 int render_view_id, | |
39 bool new_navigation); | |
40 static void RemoveTemporaryException(int render_process_host_id, | 36 static void RemoveTemporaryException(int render_process_host_id, |
41 int render_view_id); | 37 int render_view_id); |
42 | 38 |
43 // content::ResourceThrottle implementation: | 39 // content::ResourceThrottle implementation: |
44 virtual void WillStartRequest(bool* defer) OVERRIDE; | 40 virtual void WillStartRequest(bool* defer) OVERRIDE; |
45 | 41 |
46 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; | 42 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE; |
47 | 43 |
48 private: | 44 private: |
49 void ShowInterstitialIfNeeded(bool is_redirect, | 45 void ShowInterstitialIfNeeded(bool is_redirect, |
50 const GURL& url, | 46 const GURL& url, |
51 bool* defer); | 47 bool* defer); |
52 void OnInterstitialResult(bool continue_request); | 48 void OnInterstitialResult(bool continue_request); |
53 | 49 |
54 base::WeakPtrFactory<ManagedModeResourceThrottle> weak_ptr_factory_; | 50 base::WeakPtrFactory<ManagedModeResourceThrottle> weak_ptr_factory_; |
55 const net::URLRequest* request_; | 51 const net::URLRequest* request_; |
56 int render_process_host_id_; | 52 int render_process_host_id_; |
57 int render_view_id_; | 53 int render_view_id_; |
58 bool is_main_frame_; | 54 bool is_main_frame_; |
59 bool temporarily_allowed_; | 55 bool temporarily_allowed_; |
60 const ManagedModeURLFilter* url_filter_; | 56 const ManagedModeURLFilter* url_filter_; |
61 | 57 |
62 DISALLOW_COPY_AND_ASSIGN(ManagedModeResourceThrottle); | 58 DISALLOW_COPY_AND_ASSIGN(ManagedModeResourceThrottle); |
63 }; | 59 }; |
64 | 60 |
65 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ | 61 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_MODE_RESOURCE_THROTTLE_H_ |
OLD | NEW |