Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: chrome/browser/extensions/api/declarative/rules_registry_with_cache.h

Issue 11316307: Revert 170319 - Removed dead code from chrome/browser/extensions/api/declarative (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_RULES_REGISTRY_WITH_CACHE_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_WITH_CACHE_H__
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_WITH_CACHE_H__ 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_WITH_CACHE_H__
7 7
8 #include "chrome/browser/extensions/api/declarative/rules_registry.h" 8 #include "chrome/browser/extensions/api/declarative/rules_registry.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 18 matching lines...) Expand all
29 virtual bool IsReady() = 0; 29 virtual bool IsReady() = 0;
30 30
31 // Called to notify the Delegate that the rules for the given extension 31 // Called to notify the Delegate that the rules for the given extension
32 // have changed. 32 // have changed.
33 virtual void OnRulesChanged(RulesRegistryWithCache* rules_registry, 33 virtual void OnRulesChanged(RulesRegistryWithCache* rules_registry,
34 const std::string& extension_id) = 0; 34 const std::string& extension_id) = 0;
35 }; 35 };
36 36
37 explicit RulesRegistryWithCache(Delegate* delegate); 37 explicit RulesRegistryWithCache(Delegate* delegate);
38 38
39 // Returns true if we are ready to process rules.
40 bool IsReady() {
41 return !delegate_.get() || delegate_->IsReady();
42 }
43
44 // Add a callback to call when we transition to Ready.
45 void AddReadyCallback(const base::Closure& callback);
46
39 // Called by our delegate when we are ready. This is called exactly once, 47 // Called by our delegate when we are ready. This is called exactly once,
40 // if we have a delegate. 48 // if we have a delegate.
41 void OnReady(); 49 void OnReady();
42 50
43 // RulesRegistry implementation: 51 // RulesRegistry implementation:
44 virtual std::string AddRules( 52 virtual std::string AddRules(
45 const std::string& extension_id, 53 const std::string& extension_id,
46 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE; 54 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE;
47 virtual std::string RemoveRules( 55 virtual std::string RemoveRules(
48 const std::string& extension_id, 56 const std::string& extension_id,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 93
86 RulesDictionary rules_; 94 RulesDictionary rules_;
87 95
88 scoped_ptr<Delegate> delegate_; 96 scoped_ptr<Delegate> delegate_;
89 std::vector<base::Closure> ready_callbacks_; 97 std::vector<base::Closure> ready_callbacks_;
90 }; 98 };
91 99
92 } // namespace extensions 100 } // namespace extensions
93 101
94 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_WITH_CACHE_H __ 102 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_WITH_CACHE_H __
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/rules_registry_with_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698