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

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_details_permission.js

Issue 2936003003: MD Settings: Set all content setting values in Site Details Javascript. (Closed)
Patch Set: Review comments. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'site-details-permission' handles showing the state of one permission, such 7 * 'site-details-permission' handles showing the state of one permission, such
8 * as Geolocation, for a given origin. 8 * as Geolocation, for a given origin.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 30 matching lines...) Expand all
41 return this.removePatternWildcard(left) == 41 return this.removePatternWildcard(left) ==
42 this.removePatternWildcard(right); 42 this.removePatternWildcard(right);
43 }, 43 },
44 44
45 /** @private */ 45 /** @private */
46 isCookiesCategory_: function(category) { 46 isCookiesCategory_: function(category) {
47 return category == settings.ContentSettingsTypes.COOKIES; 47 return category == settings.ContentSettingsTypes.COOKIES;
48 }, 48 },
49 49
50 /** 50 /**
51 * Sets the site to display. 51 * Updates the drop-down value after |site| has changed.
52 * @param {!SiteException} site The site to display. 52 * @param {!SiteException} site The site to display.
53 * @private 53 * @private
54 */ 54 */
55 siteChanged_: function(site) { 55 siteChanged_: function(site) {
56 56 this.$.permission.value = site.setting;
57 this.browserProxy.getExceptionList(this.category)
58 .then(function(exceptionList) {
59 for (var i = 0; i < exceptionList.length; ++i) {
60 if (exceptionList[i].embeddingOrigin == site.embeddingOrigin &&
61 this.sameOrigin_(exceptionList[i].origin, site.origin)) {
62 this.$.permission.value = exceptionList[i].setting;
63 break;
64 }
65 }
66 }.bind(this));
67 }, 57 },
68 58
69 /** 59 /**
70 * Called when a site within a category has been changed. 60 * Called when a site within a category has been changed.
71 * @param {number} category The category that changed. 61 * @param {number} category The category that changed.
72 * @param {string} origin The origin of the site that changed. 62 * @param {string} origin The origin of the site that changed.
73 * @param {string} embeddingOrigin The embedding origin of the site that 63 * @param {string} embeddingOrigin The embedding origin of the site that
74 * changed. 64 * changed.
75 * @private 65 * @private
76 */ 66 */
(...skipping 22 matching lines...) Expand all
99 /** 89 /**
100 * Handles the category permission changing for this origin. 90 * Handles the category permission changing for this origin.
101 * @private 91 * @private
102 */ 92 */
103 onPermissionSelectionChange_: function() { 93 onPermissionSelectionChange_: function() {
104 this.browserProxy.setCategoryPermissionForOrigin( 94 this.browserProxy.setCategoryPermissionForOrigin(
105 this.site.origin, this.site.embeddingOrigin, this.category, 95 this.site.origin, this.site.embeddingOrigin, this.category,
106 this.$.permission.value, this.site.incognito); 96 this.$.permission.value, this.site.incognito);
107 }, 97 },
108 }); 98 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698