| 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_CHROME_CONTENT_RULES_R
EGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_R
EGISTRY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_R
EGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_R
EGISTRY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/extensions/api/declarative_content/content_condition.h" | 21 #include "chrome/browser/extensions/api/declarative_content/content_condition.h" |
| 22 #include "chrome/browser/extensions/api/declarative_content/content_predicate_ev
aluator.h" | 22 #include "chrome/browser/extensions/api/declarative_content/content_predicate_ev
aluator.h" |
| 23 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
| 25 #include "extensions/browser/api/declarative_content/content_rules_registry.h" | 25 #include "extensions/browser/api/declarative_content/content_rules_registry.h" |
| 26 #include "extensions/common/extension_id.h" | 26 #include "extensions/common/extension_id.h" |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class BrowserContext; | 29 class BrowserContext; |
| 30 class WebContents; | 30 class WebContents; |
| 31 struct FrameNavigateParams; | |
| 32 struct LoadCommittedDetails; | |
| 33 } | 31 } |
| 34 | 32 |
| 35 namespace extensions { | 33 namespace extensions { |
| 36 | 34 |
| 37 class Extension; | 35 class Extension; |
| 38 | 36 |
| 39 // The ChromeContentRulesRegistry is responsible for managing | 37 // The ChromeContentRulesRegistry is responsible for managing |
| 40 // the internal representation of rules for the Declarative Content API. | 38 // the internal representation of rules for the Declarative Content API. |
| 41 // | 39 // |
| 42 // Here is the high level overview of this functionality: | 40 // Here is the high level overview of this functionality: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 // For testing, |cache_delegate| can be NULL. In that case it constructs the | 60 // For testing, |cache_delegate| can be NULL. In that case it constructs the |
| 63 // registry with storage functionality suspended. | 61 // registry with storage functionality suspended. |
| 64 ChromeContentRulesRegistry( | 62 ChromeContentRulesRegistry( |
| 65 content::BrowserContext* browser_context, | 63 content::BrowserContext* browser_context, |
| 66 RulesCacheDelegate* cache_delegate, | 64 RulesCacheDelegate* cache_delegate, |
| 67 const PredicateEvaluatorsFactory& evaluators_factory); | 65 const PredicateEvaluatorsFactory& evaluators_factory); |
| 68 | 66 |
| 69 // ContentRulesRegistry: | 67 // ContentRulesRegistry: |
| 70 void MonitorWebContentsForRuleEvaluation( | 68 void MonitorWebContentsForRuleEvaluation( |
| 71 content::WebContents* contents) override; | 69 content::WebContents* contents) override; |
| 72 void DidNavigateMainFrame( | 70 void DidFinishNavigation( |
| 73 content::WebContents* tab, | 71 content::WebContents* tab, |
| 74 const content::LoadCommittedDetails& details, | 72 content::NavigationHandle* navigation_handle) override; |
| 75 const content::FrameNavigateParams& params) override; | |
| 76 | 73 |
| 77 // RulesRegistry: | 74 // RulesRegistry: |
| 78 std::string AddRulesImpl( | 75 std::string AddRulesImpl( |
| 79 const std::string& extension_id, | 76 const std::string& extension_id, |
| 80 const std::vector<linked_ptr<api::events::Rule>>& rules) override; | 77 const std::vector<linked_ptr<api::events::Rule>>& rules) override; |
| 81 std::string RemoveRulesImpl( | 78 std::string RemoveRulesImpl( |
| 82 const std::string& extension_id, | 79 const std::string& extension_id, |
| 83 const std::vector<std::string>& rule_identifiers) override; | 80 const std::vector<std::string>& rule_identifiers) override; |
| 84 std::string RemoveAllRulesImpl(const std::string& extension_id) override; | 81 std::string RemoveAllRulesImpl(const std::string& extension_id) override; |
| 85 | 82 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 183 |
| 187 // Manages our notification registrations. | 184 // Manages our notification registrations. |
| 188 content::NotificationRegistrar registrar_; | 185 content::NotificationRegistrar registrar_; |
| 189 | 186 |
| 190 DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); | 187 DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); |
| 191 }; | 188 }; |
| 192 | 189 |
| 193 } // namespace extensions | 190 } // namespace extensions |
| 194 | 191 |
| 195 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULE
S_REGISTRY_H_ | 192 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULE
S_REGISTRY_H_ |
| OLD | NEW |