| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 RulesRegistryWithCache, | 62 class ContentRulesRegistry : public RulesRegistryWithCache, |
| 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( | 67 ContentRulesRegistry( |
| 68 Profile* profile, | 68 Profile* profile, |
| 69 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part); | 69 scoped_ptr<RulesRegistryWithCache::RuleStorageOnUI>* ui_part, |
| 70 const WebViewKey& webview_key); |
| 70 | 71 |
| 71 // Applies all content rules given an update (CSS match change or | 72 // Applies all content rules given an update (CSS match change or |
| 72 // page navigation, for now) from the renderer. | 73 // page navigation, for now) from the renderer. |
| 73 void Apply(content::WebContents* contents, | 74 void Apply(content::WebContents* contents, |
| 74 const std::vector<std::string>& matching_css_selectors); | 75 const std::vector<std::string>& matching_css_selectors); |
| 75 | 76 |
| 76 // Applies all content rules given that a tab was just navigated. | 77 // Applies all content rules given that a tab was just navigated. |
| 77 void DidNavigateMainFrame(content::WebContents* tab, | 78 void DidNavigateMainFrame(content::WebContents* tab, |
| 78 const content::LoadCommittedDetails& details, | 79 const content::LoadCommittedDetails& details, |
| 79 const content::FrameNavigateParams& params); | 80 const content::FrameNavigateParams& params); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 content::NotificationRegistrar registrar_; | 145 content::NotificationRegistrar registrar_; |
| 145 | 146 |
| 146 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 147 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 147 | 148 |
| 148 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); | 149 DISALLOW_COPY_AND_ASSIGN(ContentRulesRegistry); |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 } // namespace extensions | 152 } // namespace extensions |
| 152 | 153 |
| 153 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGIS
TRY_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_RULES_REGIS
TRY_H_ |
| OLD | NEW |