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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 public: | 85 public: |
86 explicit ChromeSubresourceFilterClient(content::WebContents* web_contents); | 86 explicit ChromeSubresourceFilterClient(content::WebContents* web_contents); |
87 ~ChromeSubresourceFilterClient() override; | 87 ~ChromeSubresourceFilterClient() override; |
88 | 88 |
89 void MaybeAppendNavigationThrottles( | 89 void MaybeAppendNavigationThrottles( |
90 content::NavigationHandle* navigation_handle, | 90 content::NavigationHandle* navigation_handle, |
91 std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles); | 91 std::vector<std::unique_ptr<content::NavigationThrottle>>* throttles); |
92 | 92 |
93 // SubresourceFilterClient: | 93 // SubresourceFilterClient: |
94 void ToggleNotificationVisibility(bool visibility) override; | 94 void ToggleNotificationVisibility(bool visibility) override; |
95 bool ShouldSuppressActivation( | 95 bool OnPageActivationComputed(content::NavigationHandle* navigation_handle, |
96 content::NavigationHandle* navigation_handle) override; | 96 bool activated) override; |
97 void WhitelistByContentSettings(const GURL& url) override; | 97 void WhitelistByContentSettings(const GURL& url) override; |
98 void WhitelistInCurrentWebContents(const GURL& url) override; | 98 void WhitelistInCurrentWebContents(const GURL& url) override; |
99 subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer() | 99 subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer() |
100 override; | 100 override; |
101 | 101 |
102 bool did_show_ui_for_navigation() const { | 102 bool did_show_ui_for_navigation() const { |
103 return did_show_ui_for_navigation_; | 103 return did_show_ui_for_navigation_; |
104 } | 104 } |
105 | 105 |
106 static void LogAction(SubresourceFilterAction action); | 106 static void LogAction(SubresourceFilterAction action); |
107 | 107 |
108 private: | 108 private: |
109 std::set<std::string> whitelisted_hosts_; | 109 std::set<std::string> whitelisted_hosts_; |
110 | 110 |
111 // Owned by the profile. | 111 // Owned by the profile. |
112 SubresourceFilterContentSettingsManager* settings_manager_; | 112 SubresourceFilterContentSettingsManager* settings_manager_; |
113 | 113 |
114 content::WebContents* web_contents_; | 114 content::WebContents* web_contents_; |
115 bool did_show_ui_for_navigation_; | 115 bool did_show_ui_for_navigation_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(ChromeSubresourceFilterClient); | 117 DISALLOW_COPY_AND_ASSIGN(ChromeSubresourceFilterClient); |
118 }; | 118 }; |
119 | 119 |
120 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ | 120 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_CHROME_SUBRESOURCE_FILTER_CLIENT_H_ |
OLD | NEW |