summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_preference_api.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 14:50:51 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 14:50:51 +0000
commit14cc3d37e9e0d888e2ac4f2c40424031238e7fa2 (patch)
tree3859c7bcb9f3f47c3f05640d88f478e4242e393a /chrome/browser/extensions/extension_preference_api.h
parenta9f0e3b4f0dd5874bb69a8c0b5248225d165c55b (diff)
downloadchromium_src-14cc3d37e9e0d888e2ac4f2c40424031238e7fa2.zip
chromium_src-14cc3d37e9e0d888e2ac4f2c40424031238e7fa2.tar.gz
chromium_src-14cc3d37e9e0d888e2ac4f2c40424031238e7fa2.tar.bz2
Implement a PreferenceTransformerInterface and ProxyPreferenceTransformer.
These two classes shall factor out the transformation of preference representations so that the transformation can be used for subscription mechanisms as well. BUG=73994 TEST=none (trybots stay green) Review URL: http://codereview.chromium.org/6673020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_preference_api.h')
-rw-r--r--chrome/browser/extensions/extension_preference_api.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_preference_api.h b/chrome/browser/extensions/extension_preference_api.h
index 00b051f..2ec2dba4 100644
--- a/chrome/browser/extensions/extension_preference_api.h
+++ b/chrome/browser/extensions/extension_preference_api.h
@@ -10,6 +10,25 @@
#include "chrome/browser/extensions/extension_function.h"
+class Value;
+
+class PreferenceTransformerInterface {
+ public:
+ // Converts the representation of a preference as seen by the extension
+ // into a representation that is used in the pref stores of the browser.
+ // Returns the pref store representation in case of success or sets
+ // |error| and returns NULL otherwise.
+ // The ownership of the returned value is passed to the caller.
+ virtual Value* ExtensionToBrowserPref(const Value* extension_pref,
+ std::string* error) = 0;
+
+ // Converts the representation of the preference as stored in the browser
+ // into a representation that is used by the extension.
+ // Returns the extension representation in case of success or NULL otherwise.
+ // The ownership of the returned value is passed to the caller.
+ virtual Value* BrowserToExtensionPref(const Value* browser_pref) = 0;
+};
+
class GetPreferenceFunction : public SyncExtensionFunction {
public:
virtual ~GetPreferenceFunction();