Commit 1be78145 authored by battre@chromium.org's avatar battre@chromium.org

Revert 170319 - Removed dead code from chrome/browser/extensions/api/declarative

Reverting because this code will be used in the future (it is currently behind a #ifdef check).


BUG=161992


Review URL: https://chromiumcodereview.appspot.com/11412247

TBR=sergiyb@google.com
Review URL: https://codereview.chromium.org/11316307

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170757 0039d316-1c4b-4281-b951-d872f2087c98
parent 7fa3000a
...@@ -20,6 +20,10 @@ RulesRegistryWithCache::RulesRegistryWithCache(Delegate* delegate) ...@@ -20,6 +20,10 @@ RulesRegistryWithCache::RulesRegistryWithCache(Delegate* delegate)
: delegate_(delegate) { : delegate_(delegate) {
} }
void RulesRegistryWithCache::AddReadyCallback(const base::Closure& callback) {
ready_callbacks_.push_back(callback);
}
void RulesRegistryWithCache::OnReady() { void RulesRegistryWithCache::OnReady() {
for (size_t i = 0; i < ready_callbacks_.size(); ++i) for (size_t i = 0; i < ready_callbacks_.size(); ++i)
ready_callbacks_[i].Run(); ready_callbacks_[i].Run();
......
...@@ -36,6 +36,14 @@ class RulesRegistryWithCache : public RulesRegistry { ...@@ -36,6 +36,14 @@ class RulesRegistryWithCache : public RulesRegistry {
explicit RulesRegistryWithCache(Delegate* delegate); explicit RulesRegistryWithCache(Delegate* delegate);
// Returns true if we are ready to process rules.
bool IsReady() {
return !delegate_.get() || delegate_->IsReady();
}
// Add a callback to call when we transition to Ready.
void AddReadyCallback(const base::Closure& callback);
// Called by our delegate when we are ready. This is called exactly once, // Called by our delegate when we are ready. This is called exactly once,
// if we have a delegate. // if we have a delegate.
void OnReady(); void OnReady();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment