| 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 EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/gtest_prod_util.h" | |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 18 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 21 #include "extensions/common/api/events.h" | 20 #include "extensions/common/api/events.h" |
| 22 #include "extensions/common/one_shot_event.h" | 21 #include "extensions/common/one_shot_event.h" |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 25 class BrowserContext; | 24 class BrowserContext; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Returns an empty string if the function is successful or an error | 188 // Returns an empty string if the function is successful or an error |
| 190 // message otherwise. | 189 // message otherwise. |
| 191 std::string AddRulesNoFill( | 190 std::string AddRulesNoFill( |
| 192 const std::string& extension_id, | 191 const std::string& extension_id, |
| 193 const std::vector<linked_ptr<api::events::Rule>>& rules, | 192 const std::vector<linked_ptr<api::events::Rule>>& rules, |
| 194 RulesDictionary* out); | 193 RulesDictionary* out); |
| 195 | 194 |
| 196 // Same as GetRules but returns all rules owned by |extension_id| for a given | 195 // Same as GetRules but returns all rules owned by |extension_id| for a given |
| 197 // |rules| dictionary. | 196 // |rules| dictionary. |
| 198 void GetRules(const std::string& extension_id, | 197 void GetRules(const std::string& extension_id, |
| 199 RulesDictionary& rules, | 198 const RulesDictionary& rules, |
| 200 std::vector<linked_ptr<api::events::Rule>>* out); | 199 std::vector<linked_ptr<api::events::Rule>>* out); |
| 201 | 200 |
| 202 // Common processing after extension's rules have changed. | 201 // Common processing after extension's rules have changed. |
| 203 void ProcessChangedRules(const std::string& extension_id); | 202 void ProcessChangedRules(const std::string& extension_id); |
| 204 | 203 |
| 205 // Calls ProcessChangedRules if | 204 // Calls ProcessChangedRules if |
| 206 // |process_changed_rules_requested_(extension_id)| == | 205 // |process_changed_rules_requested_(extension_id)| == |
| 207 // NOT_SCHEDULED_FOR_PROCESSING. | 206 // NOT_SCHEDULED_FOR_PROCESSING. |
| 208 void MaybeProcessChangedRules(const std::string& extension_id); | 207 void MaybeProcessChangedRules(const std::string& extension_id); |
| 209 | 208 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 base::WeakPtr<RulesCacheDelegate> cache_delegate_; | 291 base::WeakPtr<RulesCacheDelegate> cache_delegate_; |
| 293 | 292 |
| 294 base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_; | 293 base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_; |
| 295 | 294 |
| 296 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); | 295 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); |
| 297 }; | 296 }; |
| 298 | 297 |
| 299 } // namespace extensions | 298 } // namespace extensions |
| 300 | 299 |
| 301 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 300 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| OLD | NEW |