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

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

Issue 2838063002: [on-hold][subresource_filter] Add ActivationTracker to track all activated contents (Closed)
Patch Set: fix incognito 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/subresource_filter/chrome_subresource_filter_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73649c90a5eb0030fb25cfa04a91aa07fa24d260..ab9d7d86b6aecfed029520c0d8e338d8abff964d 100644
--- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
+++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
@@ -11,8 +11,10 @@
#include "base/macros.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/subresource_filter/content/browser/subresource_filter_client.h"
+#include "content/public/browser/web_contents_observer.h"
class GURL;
+class SubresourceFilterProfileContext;
namespace content {
class NavigationHandle;
@@ -62,7 +64,8 @@ enum SubresourceFilterAction {
// Chrome implementation of SubresourceFilterClient.
class ChromeSubresourceFilterClient
- : public subresource_filter::SubresourceFilterClient {
+ : public subresource_filter::SubresourceFilterClient,
+ public content::WebContentsObserver {
public:
explicit ChromeSubresourceFilterClient(content::WebContents* web_contents);
~ChromeSubresourceFilterClient() override;
@@ -75,6 +78,8 @@ class ChromeSubresourceFilterClient
void WhitelistInCurrentWebContents(const GURL& url) override;
subresource_filter::VerifiedRulesetDealer::Handle* GetRulesetDealer()
override;
+ void OnPageActivated(
+ const subresource_filter::ActivationState& state) override;
bool did_show_ui_for_navigation() const {
return did_show_ui_for_navigation_;
@@ -83,9 +88,17 @@ class ChromeSubresourceFilterClient
static void LogAction(SubresourceFilterAction action);
private:
+ // content::WebContentsObserver:
+ void DidStartNavigation(
+ content::NavigationHandle* navigation_handle) override;
+ void WebContentsDestroyed() override;
+
ContentSetting GetContentSettingForUrl(const GURL& url);
std::set<std::string> whitelisted_hosts_;
- content::WebContents* web_contents_;
+
+ // Owned by the profile. Must outlive this class.
+ SubresourceFilterProfileContext* profile_context_;
+
bool did_show_ui_for_navigation_;
DISALLOW_COPY_AND_ASSIGN(ChromeSubresourceFilterClient);
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/subresource_filter/chrome_subresource_filter_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698