Chromium Code Reviews| 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_SETTINGS_SETTINGS_NAMESPACE_FRONTEND_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_FRONTEND_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 | |
| 12 class ValueStore; | |
| 13 | |
| 14 namespace extensions { | |
| 15 | |
| 16 class Extension; | |
| 17 | |
| 18 // Each namespace of the storage API implements this interface. It is mainly | |
| 19 // used to look up the appropriate ValueStore for a given extension, and to | |
| 20 // execute operations on that store. | |
| 21 class SettingsNamespaceFrontend { | |
|
not at google - send to devlin
2012/07/18 07:46:18
Name is rather indistinguishable from SettingsFron
Joao da Silva
2012/07/18 21:40:25
It's hard to name this one :-) That's a much bette
| |
| 22 public: | |
| 23 typedef base::Callback<void(ValueStore*)> StorageCallback; | |
| 24 | |
| 25 virtual ~SettingsNamespaceFrontend(); | |
| 26 | |
| 27 // The frontend should invoke |callback| with the appropriate ValueStore for | |
| 28 // the given |extension|. If the extension is not found, the |callback| | |
| 29 // should be invoked with a NULL ValueStore. | |
| 30 virtual void RunWithStorage(const Extension* extension, | |
| 31 const StorageCallback& callback) = 0; | |
| 32 | |
|
not at google - send to devlin
2012/07/18 07:46:18
If you add GetNaturalThread or whatever, a contrac
Joao da Silva
2012/07/18 21:40:25
Done. The contract for this interface is now that
| |
| 33 // Requests the frontend to delete any storage used by |extension_id|. | |
| 34 virtual void DeleteStorageSoon(const std::string& extension_id) = 0; | |
| 35 | |
| 36 }; | |
| 37 | |
| 38 } // namespace extensions | |
| 39 | |
| 40 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_NAMESPACE_FRONTEND_H_ | |
| OLD | NEW |