| Index: chrome/browser/resources/settings/site_settings/website_usage_private_api.js
|
| diff --git a/chrome/browser/resources/settings/site_settings/website_usage_private_api.js b/chrome/browser/resources/settings/site_settings/website_usage_private_api.js
|
| index 99f8858b0ba25bbe447f6f3eda66c47fceb41201..31aa874a5b5f4d09fb14113df4717a426c7cc59f 100644
|
| --- a/chrome/browser/resources/settings/site_settings/website_usage_private_api.js
|
| +++ b/chrome/browser/resources/settings/site_settings/website_usage_private_api.js
|
| @@ -16,6 +16,14 @@ Polymer({
|
| type: String,
|
| notify: true,
|
| },
|
| +
|
| + /**
|
| + * The type of data used by the given website.
|
| + */
|
| + websiteStorageType: {
|
| + type: Number,
|
| + notify: true,
|
| + },
|
| },
|
|
|
| attached: function() {
|
| @@ -26,6 +34,11 @@ Polymer({
|
| fetchUsageTotal: function(host) {
|
| settings.WebsiteUsagePrivateApi.fetchUsageTotal(host);
|
| },
|
| +
|
| + /** @param {string} origin */
|
| + clearUsage: function(origin, type) {
|
| + settings.WebsiteUsagePrivateApi.clearUsage(origin, type);
|
| + },
|
| });
|
| })();
|
|
|
| @@ -60,17 +73,30 @@ cr.define('settings.WebsiteUsagePrivateApi', function() {
|
| * @param {string} host The host that the usage was fetched for.
|
| * @param {string} usage The string showing how much data the given host
|
| * is using.
|
| + * @param {number} type The storage type.
|
| */
|
| - var returnUsageTotal = function(host, usage) {
|
| + var returnUsageTotal = function(host, usage, type) {
|
| var instance = settings.WebsiteUsagePrivateApi.websiteUsagePolymerInstance;
|
| if (instance == null)
|
| return;
|
|
|
| - if (hostName_ == host)
|
| + if (hostName_ == host) {
|
| instance.websiteDataUsage = usage;
|
| + instance.websiteStorageType = type;
|
| + }
|
| + };
|
| +
|
| + /**
|
| + * Deletes the storage being used for a given origin.
|
| + * @param {string} origin The origin to delete storage for.
|
| + * @param {number} type The type of storage to delete.
|
| + */
|
| + var clearUsage = function(origin, type) {
|
| + chrome.send('clearUsage', [origin, type]);
|
| };
|
|
|
| return { websiteUsagePolymerInstance: websiteUsagePolymerInstance,
|
| fetchUsageTotal: fetchUsageTotal,
|
| - returnUsageTotal: returnUsageTotal };
|
| + returnUsageTotal: returnUsageTotal,
|
| + clearUsage: clearUsage, };
|
| });
|
|
|