OLD | NEW |
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 * 'settings-site-settings-page' is the settings page containing privacy and | 7 * 'settings-site-settings-page' is the settings page containing privacy and |
8 * security site settings. | 8 * security site settings. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 this.setDefaultValue_(this.ContentSettingsTypes.PLUGINS, '#plugins'); | 45 this.setDefaultValue_(this.ContentSettingsTypes.PLUGINS, '#plugins'); |
46 this.setDefaultValue_(this.ContentSettingsTypes.POPUPS, '#popups'); | 46 this.setDefaultValue_(this.ContentSettingsTypes.POPUPS, '#popups'); |
47 this.setDefaultValue_(this.ContentSettingsTypes.PROTOCOL_HANDLERS, | 47 this.setDefaultValue_(this.ContentSettingsTypes.PROTOCOL_HANDLERS, |
48 '#handlers'); | 48 '#handlers'); |
49 this.setDefaultValue_(this.ContentSettingsTypes.UNSANDBOXED_PLUGINS, | 49 this.setDefaultValue_(this.ContentSettingsTypes.UNSANDBOXED_PLUGINS, |
50 '#unsandboxedPlugins'); | 50 '#unsandboxedPlugins'); |
51 }, | 51 }, |
52 | 52 |
53 setDefaultValue_: function(category, id) { | 53 setDefaultValue_: function(category, id) { |
54 this.browserProxy.getDefaultValueForContentType( | 54 this.browserProxy.getDefaultValueForContentType( |
55 category).then(function(enabled) { | 55 category).then(function(setting) { |
| 56 var enabled = this.computeIsSettingEnabled(category, setting); |
56 var description = this.computeCategoryDesc(category, enabled, false); | 57 var description = this.computeCategoryDesc(category, enabled, false); |
57 this.$$(id).innerText = description; | 58 this.$$(id).innerText = description; |
58 }.bind(this)); | 59 }.bind(this)); |
59 }, | 60 }, |
60 | 61 |
61 /** | 62 /** |
62 * Handles selection of a single category and navigates to the details for | 63 * Handles selection of a single category and navigates to the details for |
63 * that category. | 64 * that category. |
64 * @param {!Event} event The tap event. | 65 * @param {!Event} event The tap event. |
65 */ | 66 */ |
66 onTapCategory: function(event) { | 67 onTapCategory: function(event) { |
67 var category = event.currentTarget.getAttribute('category'); | 68 var category = event.currentTarget.getAttribute('category'); |
68 if (category == settings.ALL_SITES) | 69 if (category == settings.ALL_SITES) |
69 settings.navigateTo(settings.Route.SITE_SETTINGS_ALL); | 70 settings.navigateTo(settings.Route.SITE_SETTINGS_ALL); |
70 else | 71 else |
71 settings.navigateTo(this.computeCategoryRoute(category)); | 72 settings.navigateTo(this.computeCategoryRoute(category)); |
72 }, | 73 }, |
73 }); | 74 }); |
OLD | NEW |