| 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: String, |
| 48 notify: true, |
| 49 }, |
| 42 }, | 50 }, |
| 43 | 51 |
| 44 ready: function() { | 52 ready: function() { |
| 45 CrSettingsPrefs.initialized.then(function() { | 53 CrSettingsPrefs.initialized.then(function() { |
| 46 // TODO(finnur): Implement 'All Sites' list. | 54 // TODO(finnur): Implement 'All Sites' list. |
| 47 this.addCategory(settings.ContentSettingsTypes.COOKIES); | 55 this.addCategory(settings.ContentSettingsTypes.COOKIES); |
| 48 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); | 56 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); |
| 49 this.addCategory(settings.ContentSettingsTypes.CAMERA); | 57 this.addCategory(settings.ContentSettingsTypes.CAMERA); |
| 50 this.addCategory(settings.ContentSettingsTypes.MIC); | 58 this.addCategory(settings.ContentSettingsTypes.MIC); |
| 51 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); | 59 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 paperIcon.appendChild(setting); | 93 paperIcon.appendChild(setting); |
| 86 root.appendChild(paperIcon); | 94 root.appendChild(paperIcon); |
| 87 }, | 95 }, |
| 88 | 96 |
| 89 /** | 97 /** |
| 90 * Handles selection of a single category and navigates to the details for | 98 * Handles selection of a single category and navigates to the details for |
| 91 * that category. | 99 * that category. |
| 92 */ | 100 */ |
| 93 onTapCategory: function(event) { | 101 onTapCategory: function(event) { |
| 94 var description = event.currentTarget.querySelector('.flex').innerText; | 102 var description = event.currentTarget.querySelector('.flex').innerText; |
| 95 var page = this.computeCategoryTextId( | 103 this.categorySelected = this.computeCategoryTextId( |
| 96 this.computeCategoryFromDesc(description)); | 104 this.computeCategoryFromDesc(description)); |
| 97 this.currentRoute = { | 105 this.currentRoute = { |
| 98 page: this.currentRoute.page, | 106 page: this.currentRoute.page, |
| 99 section: 'privacy', | 107 section: 'privacy', |
| 100 subpage: ['site-settings', 'site-settings-category-' + page], | 108 subpage: ['site-settings', 'site-settings-category-' + |
| 109 this.categorySelected], |
| 101 }; | 110 }; |
| 102 }, | 111 }, |
| 103 }); | 112 }); |
| OLD | NEW |