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

Unified Diff: chrome/browser/resources/settings/site_settings/site_details.js

Issue 1428313002: Add a page for showing the details for a given origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/settings/site_settings/site_details.js
diff --git a/chrome/browser/resources/settings/site_settings/site_details.js b/chrome/browser/resources/settings/site_settings/site_details.js
new file mode 100644
index 0000000000000000000000000000000000000000..75eeaaf09a325ef57074afa027376d14ba314e70
--- /dev/null
+++ b/chrome/browser/resources/settings/site_settings/site_details.js
@@ -0,0 +1,91 @@
+// Copyright 2015 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.
+
+/**
+ * @fileoverview
+ * 'site-details' show the details (permissions and usage) for a given origin
+ * under Site Settings.
+ *
+ * Example:
+ *
+ * <site-details prefs="{{prefs}}" origin="{{origin}}">
+ * </site-details>
+ * ... other pages ...
+ *
+ * @group Chrome Settings Elements
+ * @element site-details
+ */
+Polymer({
+ is: 'site-details',
+
+ properties: {
+ /**
+ * Preferences state.
+ */
+ prefs: {
+ type: Object,
+ notify: true,
+ },
+
+ /**
+ * The origin that this widget is showing details for.
+ */
+ origin: {
+ type: String,
+ observer: 'onOriginChanged_',
+ },
+
+ /**
+ * The amount of data stored for the origin.
+ */
+ storedData: {
+ type: String,
+ value: '1337 MB', // TODO(finnur): Fetch actual data.
+ },
+ },
+
+ ready: function() {
+ this.$.cookies.category = settings.ContentSettingsTypes.COOKIES;
+ this.$.javascript.category = settings.ContentSettingsTypes.JAVASCRIPT;
+ this.$.popups.category = settings.ContentSettingsTypes.POPUPS;
+ this.$.geolocation.category = settings.ContentSettingsTypes.GEOLOCATION;
+ this.$.notification.category = settings.ContentSettingsTypes.NOTIFICATION;
+ this.$.fullscreen.category = settings.ContentSettingsTypes.FULLSCREEN;
+ this.$.camera.category = settings.ContentSettingsTypes.CAMERA;
+ this.$.mic.category = settings.ContentSettingsTypes.MIC;
+
+ if (this.storedData !== undefined) {
michaelpg 2015/11/09 18:26:30 i'd prefer doing this in an observer, unless there
Finnur 2015/11/10 16:00:51 Sure! Done. I suspect a chrome.send call is requi
+ this.$.usage.hidden = false;
michaelpg 2015/11/09 18:26:30 if they're logically grouped together, wrap them b
Finnur 2015/11/10 16:00:51 Usage is a header that, at the moment, only contai
+ this.$.storage.hidden = false;
+ }
+ },
+
+ onOriginChanged_: function() {
+ this.$.cookies.origin = this.origin;
michaelpg 2015/11/09 18:26:30 what if origin is set before ready? why not set th
Finnur 2015/11/10 16:00:51 There was something that was not working before wh
+ this.$.javascript.origin = this.origin;
+ this.$.popups.origin = this.origin;
+ this.$.geolocation.origin = this.origin;
+ this.$.notification.origin = this.origin;
+ this.$.fullscreen.origin = this.origin;
+ this.$.camera.origin = this.origin;
+ this.$.mic.origin = this.origin;
+ },
+
+ onClearStorage_: function() {
+ // TODO(finnur): Implement.
+ },
+
+ onClearAndReset_: function() {
+ this.$.cookies.resetPermission();
michaelpg 2015/11/09 18:26:30 consider: Array.prototype.forEach.call( this.
Finnur 2015/11/10 16:00:51 Neat trick, but I can't get it to work. No matter
michaelpg 2015/11/10 18:24:13 Sorry, should be done on "this.root" (the local DO
Finnur 2015/11/11 11:37:37 Sold!
+ this.$.javascript.resetPermission();
+ this.$.popups.resetPermission();
+ this.$.geolocation.resetPermission();
+ this.$.notification.resetPermission();
+ this.$.fullscreen.resetPermission();
+ this.$.camera.resetPermission();
+ this.$.mic.resetPermission();
+
+ this.onClearStorage_();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698