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 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 5 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 : ruleset_dealer_(ruleset_dealer) {} | 171 : ruleset_dealer_(ruleset_dealer) {} |
172 | 172 |
173 ~MockSubresourceFilterClient() override = default; | 173 ~MockSubresourceFilterClient() override = default; |
174 | 174 |
175 bool OnPageActivationComputed(content::NavigationHandle* handle, | 175 bool OnPageActivationComputed(content::NavigationHandle* handle, |
176 bool activated) override { | 176 bool activated) override { |
177 DCHECK(handle->IsInMainFrame()); | 177 DCHECK(handle->IsInMainFrame()); |
178 return whitelisted_hosts_.count(handle->GetURL().host()); | 178 return whitelisted_hosts_.count(handle->GetURL().host()); |
179 } | 179 } |
180 | 180 |
181 void WhitelistByContentSettings(const GURL& url) override {} | |
182 void WhitelistInCurrentWebContents(const GURL& url) override { | 181 void WhitelistInCurrentWebContents(const GURL& url) override { |
183 ASSERT_TRUE(url.SchemeIsHTTPOrHTTPS()); | 182 ASSERT_TRUE(url.SchemeIsHTTPOrHTTPS()); |
184 whitelisted_hosts_.insert(url.host()); | 183 whitelisted_hosts_.insert(url.host()); |
185 } | 184 } |
186 | 185 |
187 VerifiedRulesetDealer::Handle* GetRulesetDealer() override { | 186 VerifiedRulesetDealer::Handle* GetRulesetDealer() override { |
188 return ruleset_dealer_; | 187 return ruleset_dealer_; |
189 } | 188 } |
190 | 189 |
191 MOCK_METHOD1(ToggleNotificationVisibility, void(bool)); | 190 MOCK_METHOD1(ToggleNotificationVisibility, void(bool)); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 ActivationScopeTest, | 755 ActivationScopeTest, |
757 ContentSubresourceFilterDriverFactoryActivationScopeTest, | 756 ContentSubresourceFilterDriverFactoryActivationScopeTest, |
758 ::testing::ValuesIn(kActivationScopeTestData)); | 757 ::testing::ValuesIn(kActivationScopeTestData)); |
759 | 758 |
760 INSTANTIATE_TEST_CASE_P( | 759 INSTANTIATE_TEST_CASE_P( |
761 ActivationLevelTest, | 760 ActivationLevelTest, |
762 ContentSubresourceFilterDriverFactoryActivationLevelTest, | 761 ContentSubresourceFilterDriverFactoryActivationLevelTest, |
763 ::testing::ValuesIn(kActivationLevelTestData)); | 762 ::testing::ValuesIn(kActivationLevelTestData)); |
764 | 763 |
765 } // namespace subresource_filter | 764 } // namespace subresource_filter |
OLD | NEW |