diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 09:55:28 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-15 09:55:28 +0000 |
commit | 7bb3ed0a35c041526370108ba2964944887dd435 (patch) | |
tree | 48042d1ec058fe2732d76c5d3a26151308724134 /chrome/browser/extensions/extension_clear_api.h | |
parent | ebe98fbd99c04b097c0dbd6ac0b933662d723eb8 (diff) | |
download | chromium_src-7bb3ed0a35c041526370108ba2964944887dd435.zip chromium_src-7bb3ed0a35c041526370108ba2964944887dd435.tar.gz chromium_src-7bb3ed0a35c041526370108ba2964944887dd435.tar.bz2 |
chrome.clear: Increasing granularity of public API
http://codereview.chromium.org/7717023 added more granular options to
BrowsingDataRemover. This CL exposes those options to the chrome.clear
extension API. Among other things, this means that chrome.clear.cookies()
will _only_ clear cookies, not cookies and site data.
At the moment, clearing any quota managed data type will clear them all.
That is being addressed in http://codereview.chromium.org/7839029/
but is independent from changing the public interface.
BUG=94334
TEST=browser_tests
Review URL: http://codereview.chromium.org/8008012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_clear_api.h')
-rw-r--r-- | chrome/browser/extensions/extension_clear_api.h | 94 |
1 files changed, 93 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_clear_api.h b/chrome/browser/extensions/extension_clear_api.h index 69a4a52..bd58aae 100644 --- a/chrome/browser/extensions/extension_clear_api.h +++ b/chrome/browser/extensions/extension_clear_api.h @@ -17,6 +17,27 @@ class PluginPrefs; +namespace extension_clear_api_constants { + +// Keys. +extern const char kAppCacheKey[]; +extern const char kCacheKey[]; +extern const char kCookiesKey[]; +extern const char kDownloadsKey[]; +extern const char kFileSystemsKey[]; +extern const char kFormDataKey[]; +extern const char kHistoryKey[]; +extern const char kIndexedDBKey[]; +extern const char kPluginDataKey[]; +extern const char kLocalStorageKey[]; +extern const char kPasswordsKey[]; +extern const char kWebSQLKey[]; + +// Errors! +extern const char kOneAtATimeError[]; + +} // namespace extension_clear_api_constants + // This serves as a base class from which the browsing data API functions will // inherit. Each needs to be an observer of BrowsingDataRemover events, and each // will handle those events in the same way (by calling the passed-in callback @@ -47,10 +68,22 @@ class BrowsingDataExtensionFunction : public AsyncExtensionFunction, // Called when we're ready to start removing data. void StartRemoving(); - BrowsingDataRemover::TimePeriod period_; + base::Time remove_since_; int removal_mask_; }; +class ClearAppCacheFunction : public BrowsingDataExtensionFunction { + public: + ClearAppCacheFunction() {} + virtual ~ClearAppCacheFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.appcache") +}; + class ClearBrowsingDataFunction : public BrowsingDataExtensionFunction { public: ClearBrowsingDataFunction() {} @@ -99,6 +132,18 @@ class ClearDownloadsFunction : public BrowsingDataExtensionFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.downloads") }; +class ClearFileSystemsFunction : public BrowsingDataExtensionFunction { + public: + ClearFileSystemsFunction() {} + virtual ~ClearFileSystemsFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.fileSystems") +}; + class ClearFormDataFunction : public BrowsingDataExtensionFunction { public: ClearFormDataFunction() {} @@ -123,6 +168,42 @@ class ClearHistoryFunction : public BrowsingDataExtensionFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.history") }; +class ClearIndexedDBFunction : public BrowsingDataExtensionFunction { + public: + ClearIndexedDBFunction() {} + virtual ~ClearIndexedDBFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.indexedDB") +}; + +class ClearLocalStorageFunction : public BrowsingDataExtensionFunction { + public: + ClearLocalStorageFunction() {} + virtual ~ClearLocalStorageFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.localStorage") +}; + +class ClearPluginDataFunction : public BrowsingDataExtensionFunction { + public: + ClearPluginDataFunction() {} + virtual ~ClearPluginDataFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.pluginData") +}; + class ClearPasswordsFunction : public BrowsingDataExtensionFunction { public: ClearPasswordsFunction() {} @@ -135,4 +216,15 @@ class ClearPasswordsFunction : public BrowsingDataExtensionFunction { DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.passwords") }; +class ClearWebSQLFunction : public BrowsingDataExtensionFunction { + public: + ClearWebSQLFunction() {} + virtual ~ClearWebSQLFunction() {} + + protected: + // BrowsingDataTypeExtensionFunction interface method. + virtual int GetRemovalMask() const OVERRIDE; + + DECLARE_EXTENSION_FUNCTION_NAME("experimental.clear.webSQL") +}; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CLEAR_API_H_ |