| 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 COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_CLIENT_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_CLIENT_
H_ |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_CLIENT_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_CLIENT_
H_ |
| 7 | 7 |
| 8 #include "components/subresource_filter/content/browser/verified_ruleset_dealer.
h" | 8 #include "components/subresource_filter/content/browser/verified_ruleset_dealer.
h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class NavigationHandle; | 14 class NavigationHandle; |
| 15 } // namespace content | 15 } // namespace content |
| 16 | 16 |
| 17 namespace subresource_filter { | 17 namespace subresource_filter { |
| 18 | 18 |
| 19 struct ActivationState; |
| 20 |
| 19 class SubresourceFilterClient { | 21 class SubresourceFilterClient { |
| 20 public: | 22 public: |
| 21 virtual ~SubresourceFilterClient() = default; | 23 virtual ~SubresourceFilterClient() = default; |
| 22 | 24 |
| 23 // Changes the visibility of the prompt that informs the user that potentially | 25 // Changes the visibility of the prompt that informs the user that potentially |
| 24 // deceptive content has been blocked on the page according to the passed | 26 // deceptive content has been blocked on the page according to the passed |
| 25 // |visibility| parameter. When |visibility| is set to true, an icon on the | 27 // |visibility| parameter. When |visibility| is set to true, an icon on the |
| 26 // right side of the omnibox is displayed. If the user clicks on the icon then | 28 // right side of the omnibox is displayed. If the user clicks on the icon then |
| 27 // a bubble is shown that explains the feature and alalows the user to turn it | 29 // a bubble is shown that explains the feature and alalows the user to turn it |
| 28 // off. | 30 // off. |
| 29 virtual void ToggleNotificationVisibility(bool visibility) = 0; | 31 virtual void ToggleNotificationVisibility(bool visibility) = 0; |
| 30 | 32 |
| 31 // Returns true if the navigation is in a main frame and the URL is | 33 // Returns true if the navigation is in a main frame and the URL is |
| 32 // whitelisted from activation via content settings or by the per-tab | 34 // whitelisted from activation via content settings or by the per-tab |
| 33 // whitelist. | 35 // whitelist. |
| 34 virtual bool ShouldSuppressActivation( | 36 virtual bool ShouldSuppressActivation( |
| 35 content::NavigationHandle* navigation_handle) = 0; | 37 content::NavigationHandle* navigation_handle) = 0; |
| 36 | 38 |
| 37 // Adds |url| to the BLOCKED state via content settings for the current | 39 // Adds |url| to the BLOCKED state via content settings for the current |
| 38 // profile. | 40 // profile. |
| 39 virtual void WhitelistByContentSettings(const GURL& url) = 0; | 41 virtual void WhitelistByContentSettings(const GURL& url) = 0; |
| 40 | 42 |
| 41 // Adds |url| to a per-WebContents whitelist. | 43 // Adds |url| to a per-WebContents whitelist. |
| 42 virtual void WhitelistInCurrentWebContents(const GURL& url) = 0; | 44 virtual void WhitelistInCurrentWebContents(const GURL& url) = 0; |
| 43 | 45 |
| 44 virtual VerifiedRulesetDealer::Handle* GetRulesetDealer() = 0; | 46 virtual VerifiedRulesetDealer::Handle* GetRulesetDealer() = 0; |
| 47 |
| 48 // Called when the main frame is activated in this WebContents, and the signal |
| 49 // is send to the renderer. |
| 50 virtual void OnPageActivated(const ActivationState& state) = 0; |
| 45 }; | 51 }; |
| 46 | 52 |
| 47 } // namespace subresource_filter | 53 } // namespace subresource_filter |
| 48 | 54 |
| 49 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_CLIENT_
H_ | 55 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_CLIE
NT_H_ |
| OLD | NEW |