OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options.ContentSettings', function() { | 5 cr.define('options.ContentSettings', function() { |
6 /** @const */ var Page = cr.ui.pageManager.Page; | 6 /** @const */ var Page = cr.ui.pageManager.Page; |
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 // Lookup table to generate the i18n strings. | 10 // Lookup table to generate the i18n strings. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 /** | 44 /** |
45 * The saved allowed origins list. | 45 * The saved allowed origins list. |
46 * @type {options.OriginList} | 46 * @type {options.OriginList} |
47 * @private | 47 * @private |
48 */ | 48 */ |
49 allowedList_: null, | 49 allowedList_: null, |
50 | 50 |
51 /** | 51 /** |
52 * The saved blocked origins list. | 52 * The saved blocked origins list. |
53 * @type {OriginList} | 53 * @type {options.OriginList} |
54 * @private | 54 * @private |
55 */ | 55 */ |
56 blockedList_: null, | 56 blockedList_: null, |
57 | 57 |
58 /** @override */ | 58 /** @override */ |
59 initializePage: function() { | 59 initializePage: function() { |
60 Page.prototype.initializePage.call(this); | 60 Page.prototype.initializePage.call(this); |
61 | 61 |
62 $('website-settings-overlay-confirm').onclick = | 62 $('website-settings-overlay-confirm').onclick = |
63 PageManager.closeOverlay.bind(PageManager); | 63 PageManager.closeOverlay.bind(PageManager); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 var blockedList = $('blocked-origin-list'); | 110 var blockedList = $('blocked-origin-list'); |
111 options.OriginList.decorate(blockedList); | 111 options.OriginList.decorate(blockedList); |
112 this.blockedList_ = assertInstanceof(blockedList, options.OriginList); | 112 this.blockedList_ = assertInstanceof(blockedList, options.OriginList); |
113 this.blockedList_.autoExpands = true; | 113 this.blockedList_.autoExpands = true; |
114 }, | 114 }, |
115 | 115 |
116 /** | 116 /** |
117 * Populate an origin list with all of the origins with a given permission | 117 * Populate an origin list with all of the origins with a given permission |
118 * or that are using a given resource. | 118 * or that are using a given resource. |
119 * @param {OriginList} originList A list to populate. | 119 * @param {options.OriginList} originList A list to populate. |
120 * @param {!Object} originDict A dictionary of origins to their usage, which | 120 * @param {!Object} originDict A dictionary of origins to their usage, which |
121 will be used to sort the origins. | 121 will be used to sort the origins. |
122 * @private | 122 * @private |
123 */ | 123 */ |
124 populateOriginsHelper_: function(originList, originDict) { | 124 populateOriginsHelper_: function(originList, originDict) { |
125 var origins = Object.keys(originDict).map(function(origin) { | 125 var origins = Object.keys(originDict).map(function(origin) { |
126 // |usage| means the time of last usage in seconds since epoch | 126 // |usage| means the time of last usage in seconds since epoch |
127 // (Jan 1, 1970) for permissions and means the amount of local storage | 127 // (Jan 1, 1970) for permissions and means the amount of local storage |
128 // in bytes used for local storage. | 128 // in bytes used for local storage. |
129 return { | 129 return { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 WebsiteSettingsManager.showWebsiteSettings = function(hash) { | 262 WebsiteSettingsManager.showWebsiteSettings = function(hash) { |
263 PageManager.showPageByName('websiteSettings', true, {hash: '#' + hash}); | 263 PageManager.showPageByName('websiteSettings', true, {hash: '#' + hash}); |
264 }; | 264 }; |
265 | 265 |
266 // Export | 266 // Export |
267 return { | 267 return { |
268 WebsiteSettingsManager: WebsiteSettingsManager | 268 WebsiteSettingsManager: WebsiteSettingsManager |
269 }; | 269 }; |
270 }); | 270 }); |
OLD | NEW |