From be80eae925e1bb08b0584e55cd47accceba09390 Mon Sep 17 00:00:00 2001 From: "kalman@chromium.org" Date: Sat, 22 Oct 2011 03:32:07 +0000 Subject: Re-commit 106660 with the crashing test disabled. Reverted in 106671. Add onChanged events to the extension settings API, both from sync and between split mode background pages. BUG=97545 TEST=ExtensionSettingsStorageUnittest, ExtensionSettingsSyncUnittest, ExtensionSettingsApitest Review URL: http://codereview.chromium.org/8177022 TBR=rsleevi@chromium.org Review URL: http://codereview.chromium.org/8361027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106848 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_settings_api.h | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'chrome/browser/extensions/extension_settings_api.h') diff --git a/chrome/browser/extensions/extension_settings_api.h b/chrome/browser/extensions/extension_settings_api.h index 886319b..15f3fcb 100644 --- a/chrome/browser/extensions/extension_settings_api.h +++ b/chrome/browser/extensions/extension_settings_api.h @@ -21,11 +21,15 @@ class SettingsFunction : public AsyncExtensionFunction { // // Implementations should fill in args themselves, though (like RunImpl) // may return false to imply failure. - virtual bool RunWithStorage(ExtensionSettingsStorage* storage) = 0; + virtual bool RunWithStorage( + ExtensionSettingsBackend* backend, + ExtensionSettingsStorage* storage) = 0; // Sets error_ or result_ depending on the value of a storage Result, and // returns whether the Result implies success (i.e. !error). - bool UseResult(const ExtensionSettingsStorage::Result& storage_result); + bool UseResult( + ExtensionSettingsBackend* backend, + const ExtensionSettingsStorage::Result& storage_result); private: // Called via PostTask from RunImpl. Calls RunWithStorage and then @@ -38,7 +42,9 @@ class GetSettingsFunction : public SettingsFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.settings.get"); protected: - virtual bool RunWithStorage(ExtensionSettingsStorage* storage) OVERRIDE; + virtual bool RunWithStorage( + ExtensionSettingsBackend* backend, + ExtensionSettingsStorage* storage) OVERRIDE; }; class SetSettingsFunction : public SettingsFunction { @@ -46,7 +52,9 @@ class SetSettingsFunction : public SettingsFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.settings.set"); protected: - virtual bool RunWithStorage(ExtensionSettingsStorage* storage) OVERRIDE; + virtual bool RunWithStorage( + ExtensionSettingsBackend* backend, + ExtensionSettingsStorage* storage) OVERRIDE; }; class RemoveSettingsFunction : public SettingsFunction { @@ -54,7 +62,9 @@ class RemoveSettingsFunction : public SettingsFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.settings.remove"); protected: - virtual bool RunWithStorage(ExtensionSettingsStorage* storage) OVERRIDE; + virtual bool RunWithStorage( + ExtensionSettingsBackend* backend, + ExtensionSettingsStorage* storage) OVERRIDE; }; class ClearSettingsFunction : public SettingsFunction { @@ -62,7 +72,9 @@ class ClearSettingsFunction : public SettingsFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.settings.clear"); protected: - virtual bool RunWithStorage(ExtensionSettingsStorage* storage) OVERRIDE; + virtual bool RunWithStorage( + ExtensionSettingsBackend* backend, + ExtensionSettingsStorage* storage) OVERRIDE; }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_API_H_ -- cgit v1.1