summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 09:55:28 +0000
committermkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 09:55:28 +0000
commit7bb3ed0a35c041526370108ba2964944887dd435 (patch)
tree48042d1ec058fe2732d76c5d3a26151308724134
parentebe98fbd99c04b097c0dbd6ac0b933662d723eb8 (diff)
downloadchromium_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
-rw-r--r--chrome/browser/browsing_data_remover.h2
-rw-r--r--chrome/browser/extensions/extension_clear_api.cc116
-rw-r--r--chrome/browser/extensions/extension_clear_api.h94
-rw-r--r--chrome/browser/extensions/extension_clear_api_constants.cc27
-rw-r--r--chrome/browser/extensions/extension_clear_api_constants.h33
-rw-r--r--chrome/browser/extensions/extension_clear_apitest.cc23
-rw-r--r--chrome/browser/extensions/extension_clear_test.cc100
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc6
-rw-r--r--chrome/browser/extensions/extension_function_test_utils.cc4
-rw-r--r--chrome/chrome_tests.gypi2
-rw-r--r--chrome/common/extensions/api/extension_api.json179
-rw-r--r--chrome/common/extensions/docs/experimental.clear.html1626
-rw-r--r--chrome/common/extensions/docs/samples.json6
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/background.html6
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/background.js42
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/manifest.json11
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html6
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js49
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json11
19 files changed, 2068 insertions, 275 deletions
diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h
index 0257815..8e2bbf7 100644
--- a/chrome/browser/browsing_data_remover.h
+++ b/chrome/browser/browsing_data_remover.h
@@ -128,7 +128,7 @@ class BrowsingDataRemover : public content::NotificationObserver,
private:
// The clear API needs to be able to toggle removing_ in order to test that
// only one BrowsingDataRemover instance can be called at a time.
- FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, ClearOneAtATime);
+ FRIEND_TEST_ALL_PREFIXES(ExtensionClearTest, OneAtATime);
enum CacheState {
STATE_NONE,
diff --git a/chrome/browser/extensions/extension_clear_api.cc b/chrome/browser/extensions/extension_clear_api.cc
index 71a6bb1..a522509 100644
--- a/chrome/browser/extensions/extension_clear_api.cc
+++ b/chrome/browser/extensions/extension_clear_api.cc
@@ -12,7 +12,6 @@
#include "base/values.h"
#include "chrome/browser/browsing_data_remover.h"
-#include "chrome/browser/extensions/extension_clear_api_constants.h"
#include "chrome/browser/plugin_data_remover_helper.h"
#include "chrome/browser/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
@@ -23,28 +22,31 @@
using content::BrowserThread;
-namespace keys = extension_clear_api_constants;
+namespace extension_clear_api_constants {
-namespace {
+// Keys.
+const char kAppCacheKey[] = "appcache";
+const char kCacheKey[] = "cache";
+const char kCookiesKey[] = "cookies";
+const char kDownloadsKey[] = "downloads";
+const char kFileSystemsKey[] = "fileSystems";
+const char kFormDataKey[] = "formData";
+const char kHistoryKey[] = "history";
+const char kIndexedDBKey[] = "indexedDB";
+const char kPluginDataKey[] = "pluginData";
+const char kLocalStorageKey[] = "localStorage";
+const char kPasswordsKey[] = "passwords";
+const char kWebSQLKey[] = "webSQL";
-// Converts the JavaScript API's string input ("last_week") into the
-// appropriate BrowsingDataRemover::TimePeriod (in this case,
-// BrowsingDataRemover::LAST_WEEK).
-bool ParseTimePeriod(const std::string& parse,
- BrowsingDataRemover::TimePeriod* period) {
- if (parse == keys::kHourEnum)
- *period = BrowsingDataRemover::LAST_HOUR;
- else if (parse == keys::kDayEnum)
- *period = BrowsingDataRemover::LAST_DAY;
- else if (parse == keys::kWeekEnum)
- *period = BrowsingDataRemover::LAST_WEEK;
- else if (parse == keys::kMonthEnum)
- *period = BrowsingDataRemover::FOUR_WEEKS;
- else if (parse == keys::kEverythingEnum)
- *period = BrowsingDataRemover::EVERYTHING;
- else
- return false;
+// Errors!
+const char kOneAtATimeError[] = "Only one 'clear' API call can run at a time.";
+} // namespace extension_clear_api_constants
+
+namespace {
+// Converts the JavaScript API's numeric input (miliseconds since epoch) into an
+// appropriate base::Time that we can pass into the BrowsingDataRemove.
+bool ParseTimeFromValue(const double& ms_since_epoch, base::Time* time) {
return true;
}
@@ -62,21 +64,30 @@ bool DataRemovalRequested(base::DictionaryValue* dict, std::string key) {
// appropriate removal mask for the BrowsingDataRemover object.
int ParseRemovalMask(base::DictionaryValue* value) {
int GetRemovalMask = 0;
- if (DataRemovalRequested(value, keys::kCacheKey))
+ if (DataRemovalRequested(value, extension_clear_api_constants::kAppCacheKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_APPCACHE;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kCacheKey))
GetRemovalMask |= BrowsingDataRemover::REMOVE_CACHE;
- if (DataRemovalRequested(value, keys::kDownloadsKey))
+ if (DataRemovalRequested(value, extension_clear_api_constants::kCookiesKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_COOKIES;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kDownloadsKey))
GetRemovalMask |= BrowsingDataRemover::REMOVE_DOWNLOADS;
- if (DataRemovalRequested(value, keys::kFormDataKey))
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_FILE_SYSTEMS;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kFormDataKey))
GetRemovalMask |= BrowsingDataRemover::REMOVE_FORM_DATA;
- if (DataRemovalRequested(value, keys::kHistoryKey))
+ if (DataRemovalRequested(value, extension_clear_api_constants::kHistoryKey))
GetRemovalMask |= BrowsingDataRemover::REMOVE_HISTORY;
- if (DataRemovalRequested(value, keys::kPasswordsKey))
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_INDEXEDDB;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_LOCAL_STORAGE;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_PLUGIN_DATA;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
GetRemovalMask |= BrowsingDataRemover::REMOVE_PASSWORDS;
-
- // When we talk users about "cookies", we mean not just cookies, but pretty
- // much everything associated with an origin.
- if (DataRemovalRequested(value, keys::kCookiesKey))
- GetRemovalMask |= BrowsingDataRemover::REMOVE_SITE_DATA;
+ if (DataRemovalRequested(value, extension_clear_api_constants::kPasswordsKey))
+ GetRemovalMask |= BrowsingDataRemover::REMOVE_WEBSQL;
return GetRemovalMask;
}
@@ -92,14 +103,19 @@ void BrowsingDataExtensionFunction::OnBrowsingDataRemoverDone() {
bool BrowsingDataExtensionFunction::RunImpl() {
if (BrowsingDataRemover::is_removing()) {
- error_ = keys::kOneAtATimeError;
+ error_ = extension_clear_api_constants::kOneAtATimeError;
return false;
}
- // Parse the |timeframe| argument to generate the TimePeriod.
- std::string timeframe;
- EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &timeframe));
- EXTENSION_FUNCTION_VALIDATE(ParseTimePeriod(timeframe, &period_));
+ double ms_since_epoch;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetDouble(0, &ms_since_epoch));
+ // base::Time takes a double that represents seconds since epoch. JavaScript
+ // gives developers milliseconds, so do a quick conversion before populating
+ // the object. Also, Time::FromDoubleT converts double time 0 to empty Time
+ // object. So we need to do special handling here.
+ remove_since_ = (ms_since_epoch == 0) ?
+ base::Time::UnixEpoch() :
+ base::Time::FromDoubleT(ms_since_epoch / 1000.0);
removal_mask_ = GetRemovalMask();
@@ -140,7 +156,7 @@ void BrowsingDataExtensionFunction::StartRemoving() {
// we've generated above. We can use a raw pointer here, as the browsing data
// remover is responsible for deleting itself once data removal is complete.
BrowsingDataRemover* remover = new BrowsingDataRemover(
- GetCurrentBrowser()->profile(), period_, base::Time::Now());
+ GetCurrentBrowser()->profile(), remove_since_, base::Time::Now());
remover->AddObserver(this);
remover->Remove(removal_mask_);
}
@@ -154,18 +170,26 @@ int ClearBrowsingDataFunction::GetRemovalMask() const {
return 0;
}
+int ClearAppCacheFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_APPCACHE;
+}
+
int ClearCacheFunction::GetRemovalMask() const {
return BrowsingDataRemover::REMOVE_CACHE;
}
int ClearCookiesFunction::GetRemovalMask() const {
- return BrowsingDataRemover::REMOVE_SITE_DATA;
+ return BrowsingDataRemover::REMOVE_COOKIES;
}
int ClearDownloadsFunction::GetRemovalMask() const {
return BrowsingDataRemover::REMOVE_DOWNLOADS;
}
+int ClearFileSystemsFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_FILE_SYSTEMS;
+}
+
int ClearFormDataFunction::GetRemovalMask() const {
return BrowsingDataRemover::REMOVE_FORM_DATA;
}
@@ -174,6 +198,22 @@ int ClearHistoryFunction::GetRemovalMask() const {
return BrowsingDataRemover::REMOVE_HISTORY;
}
+int ClearIndexedDBFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_INDEXEDDB;
+}
+
+int ClearLocalStorageFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_LOCAL_STORAGE;
+}
+
+int ClearPluginDataFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_PLUGIN_DATA;
+}
+
int ClearPasswordsFunction::GetRemovalMask() const {
- return BrowsingDataRemover::REMOVE_CACHE;
+ return BrowsingDataRemover::REMOVE_PASSWORDS;
+}
+
+int ClearWebSQLFunction::GetRemovalMask() const {
+ return BrowsingDataRemover::REMOVE_WEBSQL;
}
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_
diff --git a/chrome/browser/extensions/extension_clear_api_constants.cc b/chrome/browser/extensions/extension_clear_api_constants.cc
deleted file mode 100644
index 4c547ab..0000000
--- a/chrome/browser/extensions/extension_clear_api_constants.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/extension_clear_api_constants.h"
-
-namespace extension_clear_api_constants {
-
-// Keys.
-const char kCacheKey[] = "cache";
-const char kCookiesKey[] = "cookies";
-const char kDownloadsKey[] = "downloads";
-const char kFormDataKey[] = "formData";
-const char kHistoryKey[] = "history";
-const char kPasswordsKey[] = "passwords";
-
-// Timeframe "enum" values.
-const char kHourEnum[] = "last_hour";
-const char kDayEnum[] = "last_day";
-const char kWeekEnum[] = "last_week";
-const char kMonthEnum[] = "last_month";
-const char kEverythingEnum[] = "everything";
-
-// Errors!
-const char kOneAtATimeError[] = "Only one 'clear' API call can run at a time.";
-
-} // namespace extension_clear_api_constants
diff --git a/chrome/browser/extensions/extension_clear_api_constants.h b/chrome/browser/extensions/extension_clear_api_constants.h
deleted file mode 100644
index b405556..0000000
--- a/chrome/browser/extensions/extension_clear_api_constants.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Constants used for the Cookies API.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_CLEAR_API_CONSTANTS_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_CLEAR_API_CONSTANTS_H_
-#pragma once
-
-namespace extension_clear_api_constants {
-
-// Keys.
-extern const char kCacheKey[];
-extern const char kCookiesKey[];
-extern const char kDownloadsKey[];
-extern const char kFormDataKey[];
-extern const char kHistoryKey[];
-extern const char kPasswordsKey[];
-
-// Timeframe "enum" values.
-extern const char kHourEnum[];
-extern const char kDayEnum[];
-extern const char kWeekEnum[];
-extern const char kMonthEnum[];
-extern const char kEverythingEnum[];
-
-// Errors!
-extern const char kOneAtATimeError[];
-
-} // namespace extension_clear_api_constants
-
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_CLEAR_API_CONSTANTS_H_
diff --git a/chrome/browser/extensions/extension_clear_apitest.cc b/chrome/browser/extensions/extension_clear_apitest.cc
deleted file mode 100644
index e295ba0..0000000
--- a/chrome/browser/extensions/extension_clear_apitest.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "chrome/browser/browsing_data_remover.h"
-#include "chrome/browser/extensions/extension_apitest.h"
-#include "chrome/common/chrome_switches.h"
-
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Clear) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableExperimentalExtensionApis);
-
- ASSERT_TRUE(RunExtensionTest("clear/api")) << message_;
-}
-
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ClearOneAtATime) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableExperimentalExtensionApis);
- BrowsingDataRemover::set_removing(true);
- ASSERT_TRUE(RunExtensionTest("clear/one_at_a_time")) << message_;
- BrowsingDataRemover::set_removing(false);
-}
diff --git a/chrome/browser/extensions/extension_clear_test.cc b/chrome/browser/extensions/extension_clear_test.cc
new file mode 100644
index 0000000..c39b3c7
--- /dev/null
+++ b/chrome/browser/extensions/extension_clear_test.cc
@@ -0,0 +1,100 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_clear_api.h"
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/string_util.h"
+#include "base/stringprintf.h"
+#include "base/values.h"
+#include "chrome/browser/browsing_data_remover.h"
+#include "chrome/browser/extensions/extension_function_test_utils.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/common/chrome_notification_types.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "content/public/browser/notification_service.h"
+
+using namespace extension_function_test_utils;
+
+namespace {
+
+const char kClearEverythingArguments[] = "[1000, {"
+ "\"appcache\": true, \"cache\": true, \"cookies\": true, "
+ "\"downloads\": true, \"fileSystems\": true, \"formData\": true, "
+ "\"history\": true, \"indexedDB\": true, \"localStorage\": true, "
+ "\"pluginData\": true, \"passwords\": true, \"webSQL\": true"
+ "}]";
+
+class ExtensionClearTest : public InProcessBrowserTest,
+ public content::NotificationObserver {
+ public:
+ base::Time GetBeginTime() {
+ return called_with_details_->removal_begin;
+ }
+
+ int GetRemovalMask() {
+ return called_with_details_->removal_mask;
+ }
+
+ protected:
+ virtual void SetUpOnMainThread() {
+ called_with_details_.reset(new BrowsingDataRemover::NotificationDetails());
+ registrar_.Add(this, chrome::NOTIFICATION_BROWSING_DATA_REMOVED,
+ content::Source<Profile>(browser()->profile()));
+ }
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE {
+ DCHECK_EQ(type, chrome::NOTIFICATION_BROWSING_DATA_REMOVED);
+
+ // We're not taking ownership of the details object, but storing a copy of
+ // it locally.
+ called_with_details_.reset(new BrowsingDataRemover::NotificationDetails(
+ *content::Details<BrowsingDataRemover::NotificationDetails>(
+ details).ptr()));
+
+ registrar_.RemoveAll();
+ }
+
+ private:
+ scoped_ptr<BrowsingDataRemover::NotificationDetails> called_with_details_;
+ content::NotificationRegistrar registrar_;
+};
+
+} // namespace
+
+IN_PROC_BROWSER_TEST_F(ExtensionClearTest, OneAtATime) {
+ BrowsingDataRemover::set_removing(true);
+ EXPECT_TRUE(MatchPattern(
+ RunFunctionAndReturnError(
+ new ClearBrowsingDataFunction(),
+ kClearEverythingArguments,
+ browser()),
+ extension_clear_api_constants::kOneAtATimeError));
+ BrowsingDataRemover::set_removing(false);
+
+ EXPECT_EQ(base::Time(), GetBeginTime());
+ EXPECT_EQ(-1, GetRemovalMask());
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionClearTest, ClearBrowsingDataEverything) {
+ EXPECT_EQ(NULL, RunFunctionAndReturnResult(new ClearBrowsingDataFunction(),
+ kClearEverythingArguments, browser()));
+
+ EXPECT_EQ(base::Time::FromDoubleT(1.0), GetBeginTime());
+ EXPECT_EQ((BrowsingDataRemover::REMOVE_SITE_DATA |
+ BrowsingDataRemover::REMOVE_CACHE |
+ BrowsingDataRemover::REMOVE_DOWNLOADS |
+ BrowsingDataRemover::REMOVE_FORM_DATA |
+ BrowsingDataRemover::REMOVE_HISTORY |
+ BrowsingDataRemover::REMOVE_PASSWORDS) &
+ // We can't remove plugin data inside a test profile.
+ ~BrowsingDataRemover::REMOVE_PLUGIN_DATA, GetRemovalMask());
+}
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 433ee75..bda138f 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -185,12 +185,18 @@ void FactoryRegistry::ResetFunctions() {
// Browsing Data.
RegisterFunction<ClearBrowsingDataFunction>();
+ RegisterFunction<ClearAppCacheFunction>();
RegisterFunction<ClearCacheFunction>();
RegisterFunction<ClearCookiesFunction>();
RegisterFunction<ClearDownloadsFunction>();
+ RegisterFunction<ClearFileSystemsFunction>();
RegisterFunction<ClearFormDataFunction>();
RegisterFunction<ClearHistoryFunction>();
+ RegisterFunction<ClearIndexedDBFunction>();
+ RegisterFunction<ClearLocalStorageFunction>();
+ RegisterFunction<ClearPluginDataFunction>();
RegisterFunction<ClearPasswordsFunction>();
+ RegisterFunction<ClearWebSQLFunction>();
// Bookmarks.
RegisterFunction<GetBookmarksFunction>();
diff --git a/chrome/browser/extensions/extension_function_test_utils.cc b/chrome/browser/extensions/extension_function_test_utils.cc
index 9953807..442013d 100644
--- a/chrome/browser/extensions/extension_function_test_utils.cc
+++ b/chrome/browser/extensions/extension_function_test_utils.cc
@@ -138,8 +138,8 @@ base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function,
RunFunction(function, args, browser, flags);
EXPECT_TRUE(function->GetError().empty()) << "Unexpected error: "
<< function->GetError();
- EXPECT_TRUE(function->GetResultValue()) << "No result value found";
- return function->GetResultValue()->DeepCopy();
+ return (function->GetResultValue() == NULL) ? NULL :
+ function->GetResultValue()->DeepCopy();
}
// This helps us be able to wait until an AsyncExtensionFunction calls
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index cc7b31a..f9fbc5b 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2521,7 +2521,7 @@
'browser/extensions/extension_browsertest.h',
'browser/extensions/extension_browsertests_misc.cc',
'browser/extensions/extension_chrome_auth_private_apitest.cc',
- 'browser/extensions/extension_clear_apitest.cc',
+ 'browser/extensions/extension_clear_test.cc',
'browser/extensions/extension_content_settings_apitest.cc',
'browser/extensions/extension_context_menu_apitest.cc',
'browser/extensions/extension_context_menu_browsertest.cc',
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index 3b43aac..6b73644 100644
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -8784,10 +8784,9 @@
"namespace": "experimental.clear",
"types": [
{
- "id": "TimePeriod",
- "type": "string",
- "enum": ["last_hour", "last_day", "last_week", "last_month", "everything"],
- "description": "The timeframe inside of which to delete browsing data. Passing 'last_day', for example, will delete all browsing data that was touched between 24 hours ago and right now, inclusive."
+ "id": "RemovalRange",
+ "type": "number",
+ "description": "Remove data accumulated on or after this date, represented in milliseconds since the epoch ('Date().GetTime()')"
}
],
"functions": [
@@ -8797,14 +8796,19 @@
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "dataToRemove",
"type": "object",
"description": "An object whose properties specify which browsing data types ought to be cleared. You may set as many or as few as you like in a single call, each is optional (defaulting to <code>false</code>).",
"properties": {
+ "appcache": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should websites' appcaches be cleared?"
+ },
"cache": {
"type": "boolean",
"optional": true,
@@ -8820,6 +8824,11 @@
"optional": true,
"description": "Should the browser's download list be cleared?"
},
+ "fileSystems": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should websites' file systems be cleared?"
+ },
"formData": {
"type": "boolean",
"optional": true,
@@ -8830,10 +8839,30 @@
"optional": true,
"description": "Should the browser's history be cleared?"
},
+ "indexedDB": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should websites' IndexedDB data be cleared?"
+ },
+ "localStorage": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should websites' local storage data be cleared?"
+ },
+ "pluginData": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should plugins' data be cleared?"
+ },
"passwords": {
"type": "boolean",
"optional": true,
"description": "Should the stored passwords be cleared?"
+ },
+ "webSQL": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Should websites' WebSQL data be cleared?"
}
}
},
@@ -8847,18 +8876,36 @@
]
},
{
+ "name": "appcache",
+ "description": "Clears websites' appcache data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' appcache data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
"name": "cache",
"description": "Clears the browser's cache.",
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
"type": "function",
- "description": "Called when the browser's cache has cleared.",
+ "description": "Called when the browser's cache has been cleared.",
"optional": true,
"parameters": []
}
@@ -8866,17 +8913,17 @@
},
{
"name": "cookies",
- "description": "Clears the browser's cookies and site data.",
+ "description": "Clears the browser's cookies.",
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
"type": "function",
- "description": "Called when the browser's cookies and site data have been cleared.",
+ "description": "Called when the browser's cookies have been cleared.",
"optional": true,
"parameters": []
}
@@ -8888,8 +8935,8 @@
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
@@ -8901,13 +8948,31 @@
]
},
{
+ "name": "fileSystems",
+ "description": "Clears websites' file system data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' file systems have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
"name": "formData",
"description": "Clears the browser's stored form data (autofill).",
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
@@ -8924,8 +8989,8 @@
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
@@ -8937,13 +9002,67 @@
]
},
{
+ "name": "indexedDB",
+ "description": "Clears websites' IndexedDB data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' IndexedDB data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "localStorage",
+ "description": "Clears websites' local storage data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' local storage has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "lsoData",
+ "description": "Clears plugins' Local Storage Object data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when plugins' Local Storage Data has been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
"name": "passwords",
"description": "Clears the browser's stored passwords.",
"type": "function",
"parameters": [
{
- "$ref": "TimePeriod",
- "name": "period"
+ "$ref": "RemovalRange",
+ "name": "since"
},
{
"name": "callback",
@@ -8953,6 +9072,24 @@
"parameters": []
}
]
+ },
+ {
+ "name": "webSQL",
+ "description": "Clears websites' WebSQL data.",
+ "type": "function",
+ "parameters": [
+ {
+ "$ref": "RemovalRange",
+ "name": "since"
+ },
+ {
+ "name": "callback",
+ "type": "function",
+ "description": "Called when websites' WebSQL databases have been cleared.",
+ "optional": true,
+ "parameters": []
+ }
+ ]
}
]
},
diff --git a/chrome/common/extensions/docs/experimental.clear.html b/chrome/common/extensions/docs/experimental.clear.html
index 7f50ea6..294fecd 100644
--- a/chrome/common/extensions/docs/experimental.clear.html
+++ b/chrome/common/extensions/docs/experimental.clear.html
@@ -323,6 +323,8 @@
<a href="#global-methods">Methods</a>
<ol>
<li>
+ <a href="#method-appcache">appcache</a>
+ </li><li>
<a href="#method-browsingData">browsingData</a>
</li><li>
<a href="#method-cache">cache</a>
@@ -331,11 +333,21 @@
</li><li>
<a href="#method-downloads">downloads</a>
</li><li>
+ <a href="#method-fileSystems">fileSystems</a>
+ </li><li>
<a href="#method-formData">formData</a>
</li><li>
<a href="#method-history">history</a>
</li><li>
+ <a href="#method-indexedDB">indexedDB</a>
+ </li><li>
+ <a href="#method-localStorage">localStorage</a>
+ </li><li>
+ <a href="#method-lsoData">lsoData</a>
+ </li><li>
<a href="#method-passwords">passwords</a>
+ </li><li>
+ <a href="#method-webSQL">webSQL</a>
</li>
</ol>
</li>
@@ -417,6 +429,206 @@
<!-- iterates over all functions -->
<div class="apiItem">
+ <a name="method-appcache"></a> <!-- method-anchor -->
+ <h4>appcache</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.appcache</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears websites' appcache data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when websites' appcache data has been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
<a name="method-browsingData"></a> <!-- method-anchor -->
<h4>browsingData</h4>
@@ -552,6 +764,74 @@
<div>
<div>
<dt>
+ <var>appcache</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should websites' appcaches be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
<var>cache</var>
<em>
@@ -756,6 +1036,74 @@
</div><div>
<div>
<dt>
+ <var>fileSystems</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should websites' file systems be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
<var>formData</var>
<em>
@@ -892,6 +1240,210 @@
</div><div>
<div>
<dt>
+ <var>indexedDB</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should websites' IndexedDB data be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>localStorage</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should websites' local storage data be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>lsoData</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should plugins' Local Shared Object data be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
<var>passwords</var>
<em>
@@ -957,6 +1509,74 @@
</dd>
</div>
+ </div><div>
+ <div>
+ <dt>
+ <var>webSQL</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>boolean</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Should websites' WebSQL data be cleared?</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
</div>
</dl>
</dd>
@@ -1208,7 +1828,7 @@
<dd class="todo" style="display: none; ">
Undocumented.
</dd>
- <dd>Called when the browser's cache has cleared.</dd>
+ <dd>Called when the browser's cache has been cleared.</dd>
<dd style="display: none; ">
This parameter was added in version
<b><span></span></b>.
@@ -1302,7 +1922,7 @@
<div class="description">
<p class="todo" style="display: none; ">Undocumented.</p>
- <p>Clears the browser's cookies and site data.</p>
+ <p>Clears the browser's cookies.</p>
<!-- PARAMETERS -->
<h4>Parameters</h4>
@@ -1408,7 +2028,7 @@
<dd class="todo" style="display: none; ">
Undocumented.
</dd>
- <dd>Called when the browser's cookies and site data have been cleared.</dd>
+ <dd>Called when the browser's cookies have been cleared.</dd>
<dd style="display: none; ">
This parameter was added in version
<b><span></span></b>.
@@ -1691,6 +2311,206 @@
</div> <!-- /description -->
</div><div class="apiItem">
+ <a name="method-fileSystems"></a> <!-- method-anchor -->
+ <h4>fileSystems</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.fileSystems</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears websites' file system data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when websites' file systems have been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
<a name="method-formData"></a> <!-- method-anchor -->
<h4>formData</h4>
@@ -2091,6 +2911,606 @@
</div> <!-- /description -->
</div><div class="apiItem">
+ <a name="method-indexedDB"></a> <!-- method-anchor -->
+ <h4>indexedDB</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.indexedDB</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears websites' IndexedDB data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when websites' IndexedDB data has been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-localStorage"></a> <!-- method-anchor -->
+ <h4>localStorage</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.localStorage</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears websites' local storage data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when websites' local storage has been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-lsoData"></a> <!-- method-anchor -->
+ <h4>lsoData</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.lsoData</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears plugins' Local Storage Object data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when plugins' Local Storage Data has been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
<a name="method-passwords"></a> <!-- method-anchor -->
<h4>passwords</h4>
@@ -2290,6 +3710,206 @@
</p>
</div> <!-- /description -->
+ </div><div class="apiItem">
+ <a name="method-webSQL"></a> <!-- method-anchor -->
+ <h4>webSQL</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.experimental.clear.webSQL</span>(<span class="null"><span style="display: none; ">, </span><span>TimePeriod</span>
+ <var><span>period</span></var></span><span class="optional"><span>, </span><span>function</span>
+ <var><span>callback</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Clears websites' WebSQL data.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>period</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a href="experimental.clear.html#type-TimePeriod">TimePeriod</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>callback</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Called when websites' WebSQL databases have been cleared.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- OBJECT METHODS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- OBJECT EVENT FIELDS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p style="display: none; ">
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
</div> <!-- /apiItem -->
</div> <!-- /apiGroup -->
diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json
index 54a1c3b..3cacc8f 100644
--- a/chrome/common/extensions/docs/samples.json
+++ b/chrome/common/extensions/docs/samples.json
@@ -40,13 +40,19 @@
"chrome.experimental.app.notify": "experimental.app.html#method-notify",
"chrome.experimental.app.resetLaunchIcon": "experimental.app.html#method-resetLaunchIcon",
"chrome.experimental.app.setLaunchIcon": "experimental.app.html#method-setLaunchIcon",
+ "chrome.experimental.clear.appcache": "experimental.clear.html#method-appcache",
"chrome.experimental.clear.browsingData": "experimental.clear.html#method-browsingData",
"chrome.experimental.clear.cache": "experimental.clear.html#method-cache",
"chrome.experimental.clear.cookies": "experimental.clear.html#method-cookies",
"chrome.experimental.clear.downloads": "experimental.clear.html#method-downloads",
+ "chrome.experimental.clear.fileSystems": "experimental.clear.html#method-fileSystems",
"chrome.experimental.clear.formData": "experimental.clear.html#method-formData",
"chrome.experimental.clear.history": "experimental.clear.html#method-history",
+ "chrome.experimental.clear.indexedDB": "experimental.clear.html#method-indexedDB",
+ "chrome.experimental.clear.localStorage": "experimental.clear.html#method-localStorage",
+ "chrome.experimental.clear.lsoData": "experimental.clear.html#method-lsoData",
"chrome.experimental.clear.passwords": "experimental.clear.html#method-passwords",
+ "chrome.experimental.clear.webSQL": "experimental.clear.html#method-webSQL",
"chrome.experimental.debugger.attach": "experimental.debugger.html#method-attach",
"chrome.experimental.debugger.detach": "experimental.debugger.html#method-detach",
"chrome.experimental.debugger.onDetach": "experimental.debugger.html#event-onDetach",
diff --git a/chrome/test/data/extensions/api_test/clear/api/background.html b/chrome/test/data/extensions/api_test/clear/api/background.html
deleted file mode 100644
index ec9baec..0000000
--- a/chrome/test/data/extensions/api_test/clear/api/background.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<!--
- * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-<script src="background.js"></script>
diff --git a/chrome/test/data/extensions/api_test/clear/api/background.js b/chrome/test/data/extensions/api_test/clear/api/background.js
deleted file mode 100644
index 08b78a8..0000000
--- a/chrome/test/data/extensions/api_test/clear/api/background.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var allTypes = {
- cache: true,
- cookies: true,
- downloads: true,
- formData: true,
- history: true,
- passwords: true
-};
-chrome.test.runTests([
- function testClearEverything() {
- chrome.experimental.clear.browsingData("everything", allTypes,
- chrome.test.callbackPass());
- },
- function testClearCache() {
- chrome.experimental.clear.cache(
- "everything", chrome.test.callbackPass());
- },
- function testClearCookies() {
- chrome.experimental.clear.cookies(
- "everything", chrome.test.callbackPass());
- },
- function testClearHistory() {
- chrome.experimental.clear.history(
- "everything", chrome.test.callbackPass());
- },
- function testClearPasswords() {
- chrome.experimental.clear.passwords(
- "everything", chrome.test.callbackPass());
- },
- function testClearDownloads() {
- chrome.experimental.clear.downloads(
- "everything", chrome.test.callbackPass());
- },
- function testClearFormData() {
- chrome.experimental.clear.formData(
- "everything", chrome.test.callbackPass());
- }
-]);
diff --git a/chrome/test/data/extensions/api_test/clear/api/manifest.json b/chrome/test/data/extensions/api_test/clear/api/manifest.json
deleted file mode 100644
index ecaa41d..0000000
--- a/chrome/test/data/extensions/api_test/clear/api/manifest.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "chrome.clear API Test",
- "version": "0.1",
- "manifest_version": 2,
- "description": "end-to-end browser test for chrome.experimental.clear API",
- "background_page": "background.html",
- "permissions": [
- "experimental",
- "clear"
- ]
-}
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html
deleted file mode 100644
index ec9baec..0000000
--- a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<!--
- * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-<script src="background.js"></script>
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js
deleted file mode 100644
index 6684cd5..0000000
--- a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var allTypes = {
- cache: true,
- cookies: true,
- downloads: true,
- formData: true,
- history: true,
- passwords: true
-};
-chrome.test.runTests([
- function testEverything() {
- chrome.experimental.clear.browsingData("everything", allTypes,
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearCache() {
- chrome.experimental.clear.cache("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearCookies() {
- chrome.experimental.clear.cookies("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearHistory() {
- chrome.experimental.clear.history("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearPasswords() {
- chrome.experimental.clear.passwords("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearDownloads() {
- chrome.experimental.clear.downloads("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- },
- function testClearFormData() {
- chrome.experimental.clear.formData("everything",
- chrome.test.callbackFail(
- 'Only one \'clear\' API call can run at a time.'));
- }
-]);
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json b/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json
deleted file mode 100644
index c06f819..0000000
--- a/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "chrome.clear API Test: One at a time.",
- "version": "0.1",
- "manifest_version": 2,
- "description": "Checks that chrome.experimental.clear APIs can only be called if one's not already running.",
- "background_page": "background.html",
- "permissions": [
- "experimental",
- "clear"
- ]
-}