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 // FullScreen is Allow vs. Ask. | |
57 var enabled = category == settings.ContentSettingsTypes.FULLSCREEN ? | |
58 setting != settings.PermissionValues.ASK : | |
59 setting != settings.PermissionValues.BLOCK; | |
Finnur
2016/08/26 11:11:44
Please move this into a helper function in SiteSet
tommycli
2016/08/26 16:52:16
Done.
| |
56 var description = this.computeCategoryDesc(category, enabled, false); | 60 var description = this.computeCategoryDesc(category, enabled, false); |
57 this.$$(id).innerText = description; | 61 this.$$(id).innerText = description; |
58 }.bind(this)); | 62 }.bind(this)); |
59 }, | 63 }, |
60 | 64 |
61 /** | 65 /** |
62 * Handles selection of a single category and navigates to the details for | 66 * Handles selection of a single category and navigates to the details for |
63 * that category. | 67 * that category. |
64 * @param {!Event} event The tap event. | 68 * @param {!Event} event The tap event. |
65 */ | 69 */ |
66 onTapCategory: function(event) { | 70 onTapCategory: function(event) { |
67 var category = event.currentTarget.getAttribute('category'); | 71 var category = event.currentTarget.getAttribute('category'); |
68 if (category == settings.ALL_SITES) | 72 if (category == settings.ALL_SITES) |
69 settings.navigateTo(settings.Route.SITE_SETTINGS_ALL); | 73 settings.navigateTo(settings.Route.SITE_SETTINGS_ALL); |
70 else | 74 else |
71 settings.navigateTo(this.computeCategoryRoute(category)); | 75 settings.navigateTo(this.computeCategoryRoute(category)); |
72 }, | 76 }, |
73 }); | 77 }); |
OLD | NEW |