| 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 * Example: | 10 * Example: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 notify: true, | 32 notify: true, |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * The current active route. | 36 * The current active route. |
| 37 */ | 37 */ |
| 38 currentRoute: { | 38 currentRoute: { |
| 39 type: Object, | 39 type: Object, |
| 40 notify: true, | 40 notify: true, |
| 41 }, | 41 }, |
| 42 | |
| 43 /** | |
| 44 * The category selected by the user. | |
| 45 */ | |
| 46 categorySelected: { | |
| 47 type: Number, | |
| 48 notify: true, | |
| 49 }, | |
| 50 }, | 42 }, |
| 51 | 43 |
| 52 ready: function() { | 44 ready: function() { |
| 53 CrSettingsPrefs.initialized.then(function() { | 45 CrSettingsPrefs.initialized.then(function() { |
| 54 // TODO(finnur): Implement 'All Sites' list. | 46 // TODO(finnur): Implement 'All Sites' list. |
| 55 this.addCategory(settings.ContentSettingsTypes.COOKIES); | 47 this.addCategory(settings.ContentSettingsTypes.COOKIES); |
| 56 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); | 48 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); |
| 57 this.addCategory(settings.ContentSettingsTypes.CAMERA); | 49 this.addCategory(settings.ContentSettingsTypes.CAMERA); |
| 58 this.addCategory(settings.ContentSettingsTypes.MIC); | 50 this.addCategory(settings.ContentSettingsTypes.MIC); |
| 59 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); | 51 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); |
| 60 this.addCategory(settings.ContentSettingsTypes.POPUPS); | 52 this.addCategory(settings.ContentSettingsTypes.POPUPS); |
| 61 this.addCategory(settings.ContentSettingsTypes.FULLSCREEN); | 53 this.addCategory(settings.ContentSettingsTypes.FULLSCREEN); |
| 62 this.addCategory(settings.ContentSettingsTypes.NOTIFICATION); | 54 this.addCategory(settings.ContentSettingsTypes.NOTIFICATIONS); |
| 63 this.addCategory(settings.ContentSettingsTypes.IMAGES); | 55 this.addCategory(settings.ContentSettingsTypes.IMAGES); |
| 64 }.bind(this)); | 56 }.bind(this)); |
| 65 }, | 57 }, |
| 66 | 58 |
| 67 /** | 59 /** |
| 68 * Adds a single category to the page. | 60 * Adds a single category to the page. |
| 69 * @param {number} category The category to add. | 61 * @param {number} category The category to add. |
| 70 */ | 62 */ |
| 71 addCategory: function(category) { | 63 addCategory: function(category) { |
| 72 var root = this.$.list; | 64 var root = this.$.list; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 93 paperIcon.appendChild(setting); | 85 paperIcon.appendChild(setting); |
| 94 root.appendChild(paperIcon); | 86 root.appendChild(paperIcon); |
| 95 }, | 87 }, |
| 96 | 88 |
| 97 /** | 89 /** |
| 98 * Handles selection of a single category and navigates to the details for | 90 * Handles selection of a single category and navigates to the details for |
| 99 * that category. | 91 * that category. |
| 100 */ | 92 */ |
| 101 onTapCategory: function(event) { | 93 onTapCategory: function(event) { |
| 102 var description = event.currentTarget.querySelector('.flex').innerText; | 94 var description = event.currentTarget.querySelector('.flex').innerText; |
| 103 this.categorySelected = this.computeCategoryFromDesc(description); | 95 var page = this.computeCategoryTextId( |
| 104 | 96 this.computeCategoryFromDesc(description)); |
| 105 this.currentRoute = { | 97 this.currentRoute = { |
| 106 page: this.currentRoute.page, | 98 page: this.currentRoute.page, |
| 107 section: 'privacy', | 99 section: 'privacy', |
| 108 subpage: ['site-settings', 'site-settings-category'], | 100 subpage: ['site-settings', 'site-settings-category-' + page], |
| 109 }; | 101 }; |
| 110 }, | 102 }, |
| 111 }); | 103 }); |
| OLD | NEW |