OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY
_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY
_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY
_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGISTRY
_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // ContentRuleActions. | 57 // ContentRuleActions. |
58 // | 58 // |
59 // The evaluation of URL related condition attributes (host_suffix, path_prefix) | 59 // The evaluation of URL related condition attributes (host_suffix, path_prefix) |
60 // is delegated to a URLMatcher, because this is capable of evaluating many | 60 // is delegated to a URLMatcher, because this is capable of evaluating many |
61 // of such URL related condition attributes in parallel. | 61 // of such URL related condition attributes in parallel. |
62 class ContentRulesRegistry : public RulesRegistry, | 62 class ContentRulesRegistry : public RulesRegistry, |
63 public content::NotificationObserver { | 63 public content::NotificationObserver { |
64 public: | 64 public: |
65 // For testing, |ui_part| can be NULL. In that case it constructs the | 65 // For testing, |ui_part| can be NULL. In that case it constructs the |
66 // registry with storage functionality suspended. | 66 // registry with storage functionality suspended. |
67 ContentRulesRegistry(Profile* profile, RulesCacheDelegate* cache_delegate); | 67 ContentRulesRegistry(Profile* profile, |
| 68 const std::string& event_name, |
| 69 RulesCacheDelegate* cache_delegate); |
68 | 70 |
69 // Applies all content rules given an update (CSS match change or | 71 // Applies all content rules given an update (CSS match change or |
70 // page navigation, for now) from the renderer. | 72 // page navigation, for now) from the renderer. |
71 void Apply(content::WebContents* contents, | 73 void Apply(content::WebContents* contents, |
72 const std::vector<std::string>& matching_css_selectors); | 74 const std::vector<std::string>& matching_css_selectors); |
73 | 75 |
74 // Applies all content rules given that a tab was just navigated. | 76 // Applies all content rules given that a tab was just navigated. |
75 void DidNavigateMainFrame(content::WebContents* tab, | 77 void DidNavigateMainFrame(content::WebContents* tab, |
76 const content::LoadCommittedDetails& details, | 78 const content::LoadCommittedDetails& details, |
77 const content::FrameNavigateParams& params); | 79 const content::FrameNavigateParams& params); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 content::NotificationRegistrar registrar_; | 143 content::NotificationRegistrar registrar_; |
142 | 144 |
143 scoped_refptr<InfoMap> extension_info_map_; | 145 scoped_refptr<InfoMap> extension_info_map_; |
144 | 146 |
145 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); | 147 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); |
146 }; | 148 }; |
147 | 149 |
148 } // namespace extensions | 150 } // namespace extensions |
149 | 151 |
150 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGIS
TRY_H_ | 152 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGIS
TRY_H_ |
OLD | NEW |