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

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

Issue 408493003: Show local storage usage on the Website Settings options page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/origin_resources_list.js
diff --git a/chrome/browser/resources/options/origin_resources_list.js b/chrome/browser/resources/options/origin_resources_list.js
index 62efad450a330719bf81cc1351ae61a2cb4b5aa9..583fdeb3783d5fff5caf416c57992c0e2a13af12 100644
--- a/chrome/browser/resources/options/origin_resources_list.js
+++ b/chrome/browser/resources/options/origin_resources_list.js
@@ -8,7 +8,15 @@ cr.define('options', function() {
function OriginListItem(origin) {
var el = cr.doc.createElement('div');
- el.origin_ = origin;
+
+ if (origin.origin) {
+ el.origin_ = origin.origin;
+ el.usage_ = origin.usage;
+ el.usage_string_ = origin.usage_string;
+ }
+ else
Bernhard Bauer 2014/07/21 11:29:29 If you have braces for the if clause, also use bra
Daniel Nishi 2014/07/21 17:53:36 Done.
+ el.origin_ = origin;
+
el.__proto__ = OriginListItem.prototype;
el.decorate();
return el;
@@ -21,8 +29,7 @@ cr.define('options', function() {
decorate: function() {
ListItem.prototype.decorate.call(this);
- this.classList.add('deletable-item');
-
+ this.className = 'deletable-item origin-list-item';
this.contentElement_ = this.ownerDocument.createElement('div');
this.appendChild(this.contentElement_);
@@ -31,6 +38,13 @@ cr.define('options', function() {
titleEl.textContent = this.origin_;
titleEl.style.backgroundImage = getFaviconImageSet(this.origin_);
this.contentElement_.appendChild(titleEl);
+
+ if (this.usage_string_) {
+ var usageEl = this.ownerDocument.createElement('span');
+ usageEl.className = 'usage';
+ usageEl.textContent = this.usage_string_;
+ this.appendChild(usageEl);
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698