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

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

Issue 10709006: Show apps protecting local data in chrome://settings/cookies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 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/options2/cookies_list.js
diff --git a/chrome/browser/resources/options2/cookies_list.js b/chrome/browser/resources/options2/cookies_list.js
index 8a4ae577c02f4d747b0f37eddc89e8d827ab04ff..b4e8b8b7e61222e51efe736725b7bf5f96737ae3 100644
--- a/chrome/browser/resources/options2/cookies_list.js
+++ b/chrome/browser/resources/options2/cookies_list.js
@@ -255,6 +255,17 @@ cr.define('options', function() {
else
text = list[i];
this.dataChild.textContent = text;
+ var apps = info.protectedByApps;
+ if (apps) {
+ for (var key in apps) {
+ var img = this.dataChild.ownerDocument.createElement('img');
+ img.src = 'chrome://extension-icon/' + key + '/16/1';
+ img.title = loadTimeData.getString('label_protected_by_apps') +
Evan Stade 2012/07/10 07:53:08 perhaps this is part of the TODO to use a better a
Bernhard Bauer 2012/07/10 09:50:59 Indeed! For this CL I'm just going with the existi
+ ' ' + apps[key].name;
+ img.className = 'protecting-app';
+ this.dataChild.appendChild(img);
+ }
+ }
if (info.quota && info.quota.totalUsage) {
this.sizeChild.textContent = info.quota.totalUsage;
}
Evan Stade 2012/07/10 07:53:08 no curlies.
Bernhard Bauer 2012/07/10 09:50:59 Done.
@@ -456,6 +467,14 @@ cr.define('options', function() {
} else if (this.data.type == 'server_bound_cert') {
info.serverBoundCerts++;
}
Evan Stade 2012/07/10 07:53:08 \n
Bernhard Bauer 2012/07/10 09:50:59 Done.
+ var apps = this.data.protectedByApps;
+ if (apps) {
+ if (!info.protectedByApps)
+ info.protectedByApps = {};
+ apps.forEach(function(appInfo) {
+ info.protectedByApps[appInfo.id] = appInfo;
+ });
+ }
}
},
@@ -498,6 +517,17 @@ cr.define('options', function() {
// Help out screen readers and such: this is a clickable thing.
div.setAttribute('role', 'button');
div.textContent = text;
+ var apps = this.data.protectedByApps;
+ if (apps) {
+ apps.forEach(function(appInfo) {
Evan Stade 2012/07/10 07:53:08 hmm, this function looks oddly familiar
Bernhard Bauer 2012/07/10 09:50:59 Extracted a function.
+ var img = div.ownerDocument.createElement('img');
+ img.src = 'chrome://extension-icon/' + appInfo.id + '/16/1';
+ img.title = loadTimeData.getString('label_protected_by_apps') +
+ ' ' + appInfo.name;
+ img.className = 'protecting-app';
+ div.appendChild(img);
+ });
+ }
var index = item.appendItem(this, div);
div.onclick = function() {
if (item.selectedIndex == index)

Powered by Google App Engine
This is Rietveld 408576698