| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ready: function() { | 52 ready: function() { |
| 53 CrSettingsPrefs.initialized.then(function() { | 53 CrSettingsPrefs.initialized.then(function() { |
| 54 // TODO(finnur): Implement 'All Sites' list. | 54 // TODO(finnur): Implement 'All Sites' list. |
| 55 this.addCategory(settings.ContentSettingsTypes.COOKIES); | 55 this.addCategory(settings.ContentSettingsTypes.COOKIES); |
| 56 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); | 56 this.addCategory(settings.ContentSettingsTypes.GEOLOCATION); |
| 57 this.addCategory(settings.ContentSettingsTypes.CAMERA); | 57 this.addCategory(settings.ContentSettingsTypes.CAMERA); |
| 58 this.addCategory(settings.ContentSettingsTypes.MIC); | 58 this.addCategory(settings.ContentSettingsTypes.MIC); |
| 59 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); | 59 this.addCategory(settings.ContentSettingsTypes.JAVASCRIPT); |
| 60 this.addCategory(settings.ContentSettingsTypes.POPUPS); | 60 this.addCategory(settings.ContentSettingsTypes.POPUPS); |
| 61 this.addCategory(settings.ContentSettingsTypes.FULLSCREEN); | 61 this.addCategory(settings.ContentSettingsTypes.FULLSCREEN); |
| 62 this.addCategory(settings.ContentSettingsTypes.NOTIFICATION); | 62 this.addCategory(settings.ContentSettingsTypes.NOTIFICATIONS); |
| 63 this.addCategory(settings.ContentSettingsTypes.IMAGES); | 63 this.addCategory(settings.ContentSettingsTypes.IMAGES); |
| 64 }.bind(this)); | 64 }.bind(this)); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * Adds a single category to the page. | 68 * Adds a single category to the page. |
| 69 * @param {number} category The category to add. | 69 * @param {number} category The category to add. |
| 70 */ | 70 */ |
| 71 addCategory: function(category) { | 71 addCategory: function(category) { |
| 72 var root = this.$.list; | 72 var root = this.$.list; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 95 }, | 95 }, |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * 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 |
| 99 * that category. | 99 * that category. |
| 100 */ | 100 */ |
| 101 onTapCategory: function(event) { | 101 onTapCategory: function(event) { |
| 102 var description = event.currentTarget.querySelector('.flex').innerText; | 102 var description = event.currentTarget.querySelector('.flex').innerText; |
| 103 this.categorySelected = this.computeCategoryFromDesc(description); | 103 this.categorySelected = this.computeCategoryFromDesc(description); |
| 104 | 104 |
| 105 var page = this.computeCategoryTextId(this.categorySelected); |
| 105 this.currentRoute = { | 106 this.currentRoute = { |
| 106 page: this.currentRoute.page, | 107 page: this.currentRoute.page, |
| 107 section: 'privacy', | 108 section: 'privacy', |
| 108 subpage: ['site-settings', 'site-settings-category'], | 109 subpage: ['site-settings', 'site-settings-category-' + page], |
| 109 }; | 110 }; |
| 110 }, | 111 }, |
| 111 }); | 112 }); |
| OLD | NEW |