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

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: Address feedback 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..cc6d5616cf136acb489007c5c4599b4b3e61bb03
--- /dev/null
+++ b/chrome/browser/resources/settings/site_settings/site_details.js
@@ -0,0 +1,74 @@
+// 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: String,
+
+ /**
+ * The amount of data stored for the origin.
+ */
+ storedData_: {
+ type: String,
+ observer: 'onStoredDataChanged_',
+ },
+ },
+
+ 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;
+
+ this.storedData_ = '1337 MB'; // TODO(finnur): Fetch actual data.
+ },
+
+ onStoredDataChanged_: function() {
+ this.$.usage.hidden = false;
+ this.$.storage.hidden = false;
+ },
+
+ onClearStorage_: function() {
+ // TODO(finnur): Implement.
+ },
+
+ onClearAndReset_: function() {
+ Array.prototype.forEach.call(
+ this.root.querySelectorAll('site-details-permission'),
+ function(element) { element.resetPermission(); });
+
+ this.onClearStorage_();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698