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

Unified Diff: extensions/browser/api/declarative_content/content_rules_registry.h

Issue 1166393002: Reland "Encapsulate CSS selector declarative content condition tracking" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: crash fixes and tests Created 5 years, 6 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
« chrome/browser/extensions/tab_helper.cc ('K') | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/declarative_content/content_rules_registry.h
diff --git a/extensions/browser/api/declarative_content/content_rules_registry.h b/extensions/browser/api/declarative_content/content_rules_registry.h
index f7f08bdb079a0ab36b3694c7ede75938861a130c..6063942f30571422f6582e5bf0083d1bd69c98c5 100644
--- a/extensions/browser/api/declarative_content/content_rules_registry.h
+++ b/extensions/browser/api/declarative_content/content_rules_registry.h
@@ -23,6 +23,12 @@ namespace extensions {
// to allow RulesRegistryService to be moved to //extensions.
// TODO(wjmaclean): Remove this once ContentRulesRegistry moves to
// //extensions.
+//
+// Note: when dealing with WebContents associated with OffTheRecord contexts,
+// functions on this interface must be invoked for BOTH the Original and
+// OffTheRecord ContentRulesRegistry instances. This is necessary because the
+// Original ContentRulesRegistry instance handles spanning-mode incognito
+// extensions.
class ContentRulesRegistry : public RulesRegistry {
public:
ContentRulesRegistry(content::BrowserContext* browser_context,
@@ -36,11 +42,9 @@ class ContentRulesRegistry : public RulesRegistry {
cache_delegate,
rules_registry_id) {}
- // Applies all content rules given an update (CSS match change or
- // page navigation, for now) from the renderer.
- virtual void Apply(
- content::WebContents* contents,
- const std::vector<std::string>& matching_css_selectors) = 0;
+ // Notifies the registry that it should evaluate rules for |contents|.
+ virtual void MonitorWebContentsForRuleEvaluation(
+ content::WebContents* contents) = 0;
// Applies all content rules given that a tab was just navigated.
virtual void DidNavigateMainFrame(
@@ -48,13 +52,6 @@ class ContentRulesRegistry : public RulesRegistry {
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) = 0;
- // Applies all content rules given that a tab was just navigated on the
- // original context. Only invoked on the OffTheRecord registry instance.
- virtual void DidNavigateMainFrameOfOriginalContext(
Mike Wittman 2015/06/09 02:37:35 I coalesced this back into DidNavigateMainFrame si
- content::WebContents* tab,
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) = 0;
-
protected:
~ContentRulesRegistry() override {}
« chrome/browser/extensions/tab_helper.cc ('K') | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698