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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview
7 * 'site-details' show the details (permissions and usage) for a given origin
8 * under Site Settings.
9 *
10 * Example:
11 *
12 * <site-details prefs="{{prefs}}" origin="{{origin}}">
13 * </site-details>
14 * ... other pages ...
15 *
16 * @group Chrome Settings Elements
17 * @element site-details
18 */
19 Polymer({
20 is: 'site-details',
21
22 properties: {
23 /**
24 * Preferences state.
25 */
26 prefs: {
27 type: Object,
28 notify: true,
29 },
30
31 /**
32 * The origin that this widget is showing details for.
33 */
34 origin: String,
35
36 /**
37 * The amount of data stored for the origin.
38 */
39 storedData_: {
40 type: String,
41 observer: 'onStoredDataChanged_',
42 },
43 },
44
45 ready: function() {
46 this.$.cookies.category = settings.ContentSettingsTypes.COOKIES;
47 this.$.javascript.category = settings.ContentSettingsTypes.JAVASCRIPT;
48 this.$.popups.category = settings.ContentSettingsTypes.POPUPS;
49 this.$.geolocation.category = settings.ContentSettingsTypes.GEOLOCATION;
50 this.$.notification.category = settings.ContentSettingsTypes.NOTIFICATION;
51 this.$.fullscreen.category = settings.ContentSettingsTypes.FULLSCREEN;
52 this.$.camera.category = settings.ContentSettingsTypes.CAMERA;
53 this.$.mic.category = settings.ContentSettingsTypes.MIC;
54
55 this.storedData_ = '1337 MB'; // TODO(finnur): Fetch actual data.
56 },
57
58 onStoredDataChanged_: function() {
59 this.$.usage.hidden = false;
60 this.$.storage.hidden = false;
61 },
62
63 onClearStorage_: function() {
64 // TODO(finnur): Implement.
65 },
66
67 onClearAndReset_: function() {
68 Array.prototype.forEach.call(
69 this.root.querySelectorAll('site-details-permission'),
70 function(element) { element.resetPermission(); });
71
72 this.onClearStorage_();
73 },
74 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698