| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_STORAGE_DELEGAT
E_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_STORAGE_DELEGAT
E_H__ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/memory/ref_counted.h" |
| 12 |
| 13 #include "chrome/browser/extensions/api/declarative/rules_registry_with_cache.h" |
| 14 |
| 15 class Profile; |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 // A Delegate to the RulesRegistryWithCache which handles reading/writing rules |
| 20 // to the extension state store. This class should be initialized on the UI |
| 21 // thread, but used on the RulesRegistry thread. |
| 22 class RulesRegistryStorageDelegate : public RulesRegistryWithCache::Delegate { |
| 23 public: |
| 24 RulesRegistryStorageDelegate(); |
| 25 virtual ~RulesRegistryStorageDelegate(); |
| 26 |
| 27 // Called on the UI thread to initialize the delegate. |
| 28 void Init(Profile* profile, |
| 29 RulesRegistryWithCache* rules_registry, |
| 30 const std::string& storage_key); |
| 31 |
| 32 // RulesRegistryWithCache::Delegate |
| 33 virtual bool IsReady() OVERRIDE; |
| 34 virtual void OnRulesChanged(RulesRegistryWithCache* rules_registry, |
| 35 const std::string& extension_id) OVERRIDE; |
| 36 |
| 37 private: |
| 38 class Inner; |
| 39 |
| 40 scoped_refptr<Inner> inner_; |
| 41 }; |
| 42 |
| 43 } // namespace extensions |
| 44 |
| 45 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_REGISTRY_STORAGE_DELE
GATE_H__ |
| OLD | NEW |