OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ |
6 #define CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ | 6 #define CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 : public content::WebContentsUserData<ChromeSubresourceFilterClient>, | 88 : public content::WebContentsUserData<ChromeSubresourceFilterClient>, |
89 public subresource_filter::SubresourceFilterClient { | 89 public subresource_filter::SubresourceFilterClient { |
90 public: | 90 public: |
91 explicit ChromeSubresourceFilterClient(content::WebContents* web_contents); | 91 explicit ChromeSubresourceFilterClient(content::WebContents* web_contents); |
92 ~ChromeSubresourceFilterClient() override; | 92 ~ChromeSubresourceFilterClient() override; |
93 | 93 |
94 void MaybeAppendNavigationThrottles( | 94 void MaybeAppendNavigationThrottles( |
95 content::NavigationHandle* navigation_handle, | 95 content::NavigationHandle* navigation_handle, |
96 std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles); | 96 std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles); |
97 | 97 |
| 98 void OnReloadRequested(); |
| 99 |
98 // SubresourceFilterClient: | 100 // SubresourceFilterClient: |
99 void ToggleNotificationVisibility(bool visibility) override; | 101 void ToggleNotificationVisibility(bool visibility) override; |
100 bool OnPageActivationComputed(content::NavigationHandle* navigation_handle, | 102 bool OnPageActivationComputed(content::NavigationHandle* navigation_handle, |
101 bool activated) override; | 103 bool activated) override; |
102 void WhitelistByContentSettings(const GURL& url) override; | |
103 void WhitelistInCurrentWebContents(const GURL& url) override; | 104 void WhitelistInCurrentWebContents(const GURL& url) override; |
104 subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer() | 105 subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer() |
105 override; | 106 override; |
106 | 107 |
107 bool did_show_ui_for_navigation() const { | 108 bool did_show_ui_for_navigation() const { |
108 return did_show_ui_for_navigation_; | 109 return did_show_ui_for_navigation_; |
109 } | 110 } |
110 | 111 |
111 static void LogAction(SubresourceFilterAction action); | 112 static void LogAction(SubresourceFilterAction action); |
112 | 113 |
113 private: | 114 private: |
| 115 void WhitelistByContentSettings(const GURL& url); |
114 std::set<std::string> whitelisted_hosts_; | 116 std::set<std::string> whitelisted_hosts_; |
115 | 117 |
116 // Owned by the profile. | 118 // Owned by the profile. |
117 SubresourceFilterContentSettingsManager* settings_manager_; | 119 SubresourceFilterContentSettingsManager* settings_manager_; |
118 | 120 |
119 content::WebContents* web_contents_; | 121 content::WebContents* web_contents_; |
120 bool did_show_ui_for_navigation_; | 122 bool did_show_ui_for_navigation_; |
121 | 123 |
122 DISALLOW_COPY_AND_ASSIGN(ChromeSubresourceFilterClient); | 124 DISALLOW_COPY_AND_ASSIGN(ChromeSubresourceFilterClient); |
123 }; | 125 }; |
124 | 126 |
125 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ | 127 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ |
OLD | NEW |