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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ChromeContentRulesRegistry(content::BrowserContext* browser_context, | 67 ChromeContentRulesRegistry(content::BrowserContext* browser_context, |
68 RulesCacheDelegate* cache_delegate); | 68 RulesCacheDelegate* cache_delegate); |
69 | 69 |
70 // ChromeContentRulesRegistry implementation: | 70 // ChromeContentRulesRegistry implementation: |
71 // Applies all content rules given an update (CSS match change or | 71 // Applies all content rules given an update (CSS match change or |
72 // page navigation, for now) from the renderer. | 72 // page navigation, for now) from the renderer. |
73 virtual void Apply( | 73 virtual void Apply( |
74 content::WebContents* contents, | 74 content::WebContents* contents, |
75 const std::vector<std::string>& matching_css_selectors) OVERRIDE; | 75 const std::vector<std::string>& matching_css_selectors) override; |
76 | 76 |
77 // Applies all content rules given that a tab was just navigated. | 77 // Applies all content rules given that a tab was just navigated. |
78 virtual void DidNavigateMainFrame( | 78 virtual void DidNavigateMainFrame( |
79 content::WebContents* tab, | 79 content::WebContents* tab, |
80 const content::LoadCommittedDetails& details, | 80 const content::LoadCommittedDetails& details, |
81 const content::FrameNavigateParams& params) OVERRIDE; | 81 const content::FrameNavigateParams& params) override; |
82 | 82 |
83 // Implementation of RulesRegistry: | 83 // Implementation of RulesRegistry: |
84 virtual std::string AddRulesImpl( | 84 virtual std::string AddRulesImpl( |
85 const std::string& extension_id, | 85 const std::string& extension_id, |
86 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; | 86 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) override; |
87 virtual std::string RemoveRulesImpl( | 87 virtual std::string RemoveRulesImpl( |
88 const std::string& extension_id, | 88 const std::string& extension_id, |
89 const std::vector<std::string>& rule_identifiers) OVERRIDE; | 89 const std::vector<std::string>& rule_identifiers) override; |
90 virtual std::string RemoveAllRulesImpl( | 90 virtual std::string RemoveAllRulesImpl( |
91 const std::string& extension_id) OVERRIDE; | 91 const std::string& extension_id) override; |
92 | 92 |
93 // content::NotificationObserver implementation. | 93 // content::NotificationObserver implementation. |
94 virtual void Observe(int type, | 94 virtual void Observe(int type, |
95 const content::NotificationSource& source, | 95 const content::NotificationSource& source, |
96 const content::NotificationDetails& details) OVERRIDE; | 96 const content::NotificationDetails& details) override; |
97 | 97 |
98 // Returns true if this object retains no allocated data. Only for debugging. | 98 // Returns true if this object retains no allocated data. Only for debugging. |
99 bool IsEmpty() const; | 99 bool IsEmpty() const; |
100 | 100 |
101 protected: | 101 protected: |
102 virtual ~ChromeContentRulesRegistry(); | 102 virtual ~ChromeContentRulesRegistry(); |
103 | 103 |
104 // Virtual for testing: | 104 // Virtual for testing: |
105 virtual base::Time GetExtensionInstallationTime( | 105 virtual base::Time GetExtensionInstallationTime( |
106 const std::string& extension_id) const; | 106 const std::string& extension_id) const; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 content::NotificationRegistrar registrar_; | 145 content::NotificationRegistrar registrar_; |
146 | 146 |
147 scoped_refptr<InfoMap> extension_info_map_; | 147 scoped_refptr<InfoMap> extension_info_map_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); | 149 DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace extensions | 152 } // namespace extensions |
153 | 153 |
154 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULE
S_REGISTRY_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULE
S_REGISTRY_H_ |
OLD | NEW |