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

Side by Side Diff: extensions/browser/api/declarative_content/content_rules_registry.h

Issue 1159733004: Encapsulate CSS selector declarative content condition tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stars-declarative-content-range-for
Patch Set: only notify navigation for tracked WebContents, address comments 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__ 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__
6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__ 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 18 matching lines...) Expand all
29 const std::string& event_name, 29 const std::string& event_name,
30 content::BrowserThread::ID owner_thread, 30 content::BrowserThread::ID owner_thread,
31 RulesCacheDelegate* cache_delegate, 31 RulesCacheDelegate* cache_delegate,
32 int rules_registry_id) 32 int rules_registry_id)
33 : RulesRegistry(browser_context, 33 : RulesRegistry(browser_context,
34 event_name, 34 event_name,
35 owner_thread, 35 owner_thread,
36 cache_delegate, 36 cache_delegate,
37 rules_registry_id) {} 37 rules_registry_id) {}
38 38
39 // Applies all content rules given an update (CSS match change or
40 // page navigation, for now) from the renderer.
41 virtual void Apply(
42 content::WebContents* contents,
43 const std::vector<std::string>& matching_css_selectors) = 0;
44
45 // Applies all content rules given that a tab was just navigated. 39 // Applies all content rules given that a tab was just navigated.
46 virtual void DidNavigateMainFrame( 40 virtual void DidNavigateMainFrame(
47 content::WebContents* tab, 41 content::WebContents* tab,
48 const content::LoadCommittedDetails& details, 42 const content::LoadCommittedDetails& details,
49 const content::FrameNavigateParams& params) = 0; 43 const content::FrameNavigateParams& params) = 0;
50 44
51 // Applies all content rules given that a tab was just navigated on the 45 // Applies all content rules given that a tab was just navigated on the
52 // original context. Only invoked on the OffTheRecord registry instance. 46 // original context. Only invoked on the OffTheRecord registry instance.
53 virtual void DidNavigateMainFrameOfOriginalContext( 47 virtual void DidNavigateMainFrameOfOriginalContext(
54 content::WebContents* tab, 48 content::WebContents* tab,
55 const content::LoadCommittedDetails& details, 49 const content::LoadCommittedDetails& details,
56 const content::FrameNavigateParams& params) = 0; 50 const content::FrameNavigateParams& params) = 0;
57 51
58 protected: 52 protected:
59 ~ContentRulesRegistry() override {} 53 ~ContentRulesRegistry() override {}
60 54
61 private: 55 private:
62 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); 56 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry);
63 }; 57 };
64 58
65 } // namespace extensions 59 } // namespace extensions
66 60
67 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__ 61 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY_H__
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698