Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: chrome/browser/resources/options/cookies_list.js

Issue 7387007: Adding usage and quota entry to chrome://settings/cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Omit column header Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/cookies_list.js
diff --git a/chrome/browser/resources/options/cookies_list.js b/chrome/browser/resources/options/cookies_list.js
index 37a93ff445c665ab526387aa2b846b067f68d715..3ac87c603c269a836eaa7d88cf01832e1eb7ee62 100644
--- a/chrome/browser/resources/options/cookies_list.js
+++ b/chrome/browser/resources/options/cookies_list.js
@@ -101,6 +101,8 @@ cr.define('options', function() {
this.siteChild.className = 'cookie-site';
this.dataChild = this.ownerDocument.createElement('div');
this.dataChild.className = 'cookie-data';
+ this.sizeChild = this.ownerDocument.createElement('div');
+ this.sizeChild.className = 'cookie-size';
this.itemsChild = this.ownerDocument.createElement('div');
this.itemsChild.className = 'cookie-items';
this.infoChild = this.ownerDocument.createElement('div');
@@ -113,6 +115,7 @@ cr.define('options', function() {
var content = this.contentElement;
content.appendChild(this.siteChild);
content.appendChild(this.dataChild);
+ content.appendChild(this.sizeChild);
content.appendChild(this.itemsChild);
this.itemsChild.appendChild(this.infoChild);
if (this.origin && this.origin.data) {
@@ -232,6 +235,13 @@ cr.define('options', function() {
else
text = list[i];
this.dataChild.textContent = text;
+ if (info.quota && info.quota.totalUsage) {
+ this.sizeChild.textContent = info.quota.totalUsage;
+ } else {
+ this.sizeChild.textContent =
+ localStrings.getString('usage_unavailable');
Mike Mammarella 2011/07/29 17:59:26 Without the header it might be better to leave thi
tzik 2011/08/01 02:46:26 Done.
+ }
+
if (this.expanded)
this.updateItems_();
},
@@ -412,18 +422,26 @@ cr.define('options', function() {
for (var i = 0; i < this.children.length; ++i)
this.children[i].collectSummaryInfo(info);
} else if (this.data && !this.data.hasChildren) {
- if (this.data.type == 'cookie')
+ if (this.data.type == 'cookie') {
info.cookies++;
- else if (this.data.type == 'database')
+ } else if (this.data.type == 'database') {
info.database = true;
- else if (this.data.type == 'local_storage')
+ } else if (this.data.type == 'local_storage') {
info.localStorage = true;
- else if (this.data.type == 'app_cache')
+ } else if (this.data.type == 'app_cache') {
info.appCache = true;
- else if (this.data.type == 'indexed_db')
+ } else if (this.data.type == 'indexed_db') {
info.indexedDb = true;
- else if (this.data.type == 'file_system')
+ } else if (this.data.type == 'file_system') {
info.fileSystem = true;
+ } else if (this.data.type == 'quota') {
+ info.quota = {
+ totalUsage: this.data.totalUsage,
+ temporaryUsage: this.data.temporaryUsage,
+ persistentUsage: this.data.persistentUsage,
+ persistentQuota: this.data.persistentQuota,
+ };
+ }
}
},
@@ -456,6 +474,8 @@ cr.define('options', function() {
text = localStrings.getString('cookie_file_system');
break;
}
+ if (!text)
+ return;
var div = item.ownerDocument.createElement('div');
div.className = 'cookie-item';
// Help out screen readers and such: this is a clickable thing.

Powered by Google App Engine
This is Rietveld 408576698