Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7577)

Unified Diff: chrome/browser/subresource_filter/chrome_subresource_filter_client.h

Issue 2795053002: [subresource_filter] Implement the "Smart" UI on Android (Closed)
Patch Set: jkarlin review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/subresource_filter/chrome_subresource_filter_client.h
diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.h b/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
index e706577dff44b7d68c78d3330bb3144748e32cd8..0bd9bac3cd61f8d0acf00df04a25ee86bdba3321 100644
--- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
+++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
@@ -10,6 +10,7 @@
#include "components/subresource_filter/content/browser/subresource_filter_client.h"
class GURL;
+class SubresourceFilterContentSettingsManager;
namespace content {
class WebContents;
@@ -37,7 +38,8 @@ enum SubresourceFilterAction {
// Content setting updated automatically via the standard UI.
kActionContentSettingsBlockedFromUI,
- // Content settings which target specific origins (e.g. no wildcards).
+ // Content settings which target specific origins (e.g. no wildcards). These
+ // updates do not include updates from the main UI.
kActionContentSettingsAllowed,
kActionContentSettingsBlocked,
@@ -53,6 +55,16 @@ enum SubresourceFilterAction {
// flexible.
kActionContentSettingsWildcardUpdate,
+ // The UI was suppressed due to "smart" logic which tries not to spam the UI
+ // on navigations on the same origin within a certain time.
+ kActionUISuppressed,
+
+ // The feature was blocked via content setting manually while smart UI was
+ // suppressing the UI. Potentially indicates that the smart UI is too
+ // aggressive if this happens frequently. This is a reported alongside
+ // kActionContentSettingsBlocked if the UI is currently in suppressed mode.
+ kActionContentSettingsBlockedWhileUISuppressed,
+
kActionLastEntry
};
@@ -65,15 +77,22 @@ class ChromeSubresourceFilterClient
// SubresourceFilterClient:
void ToggleNotificationVisibility(bool visibility) override;
- bool IsWhitelistedByContentSettings(const GURL& url) override;
- void WhitelistByContentSettings(const GURL& url) override;
+ bool IsWhitelistedByContentSettings(const GURL& top_level_url) override;
+ void WhitelistByContentSettings(const GURL& top_level_url) override;
subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer()
override;
+ void OnActivationComputed(
+ const GURL& top_level_url,
+ const subresource_filter::ActivationState& state) override;
static void LogAction(SubresourceFilterAction action);
+ bool shown_for_navigation() const { return shown_for_navigation_; }
+
private:
- ContentSetting GetContentSettingForUrl(const GURL& url);
+ // Owned by the profile.
+ SubresourceFilterContentSettingsManager* settings_manager_;
+
content::WebContents* web_contents_;
bool shown_for_navigation_;

Powered by Google App Engine
This is Rietveld 408576698