| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * An example empty pref. | 6 * An example empty pref. |
| 7 * @type {SiteSettingsPref} | 7 * @type {SiteSettingsPref} |
| 8 */ | 8 */ |
| 9 var prefsEmpty = { | 9 var prefsEmpty = { |
| 10 defaults: { | 10 defaults: { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } else if (contentType == settings.ContentSettingsTypes.PLUGINS) { | 120 } else if (contentType == settings.ContentSettingsTypes.PLUGINS) { |
| 121 pref = this.prefs_.defaults.plugins; | 121 pref = this.prefs_.defaults.plugins; |
| 122 } else if ( | 122 } else if ( |
| 123 contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) { | 123 contentType == settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS) { |
| 124 pref = this.prefs_.defaults.unsandboxed_plugins; | 124 pref = this.prefs_.defaults.unsandboxed_plugins; |
| 125 } else { | 125 } else { |
| 126 console.log('getDefault received unknown category: ' + contentType); | 126 console.log('getDefault received unknown category: ' + contentType); |
| 127 } | 127 } |
| 128 | 128 |
| 129 assert(pref != undefined, 'Pref is missing for ' + contentType); | 129 assert(pref != undefined, 'Pref is missing for ' + contentType); |
| 130 return Promise.resolve(pref != 'block'); | 130 return Promise.resolve(pref); |
| 131 }, | 131 }, |
| 132 | 132 |
| 133 /** @override */ | 133 /** @override */ |
| 134 getExceptionList: function(contentType) { | 134 getExceptionList: function(contentType) { |
| 135 this.methodCalled('getExceptionList', contentType); | 135 this.methodCalled('getExceptionList', contentType); |
| 136 | 136 |
| 137 var pref = undefined; | 137 var pref = undefined; |
| 138 if (contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS) | 138 if (contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS) |
| 139 pref = this.prefs_.exceptions.auto_downloads; | 139 pref = this.prefs_.exceptions.auto_downloads; |
| 140 else if (contentType == settings.ContentSettingsTypes.BACKGROUND_SYNC) | 140 else if (contentType == settings.ContentSettingsTypes.BACKGROUND_SYNC) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 }, | 179 }, |
| 180 | 180 |
| 181 /** @override */ | 181 /** @override */ |
| 182 setCategoryPermissionForOrigin: function( | 182 setCategoryPermissionForOrigin: function( |
| 183 primaryPattern, secondaryPattern, contentType, value) { | 183 primaryPattern, secondaryPattern, contentType, value) { |
| 184 this.methodCalled('setCategoryPermissionForOrigin', | 184 this.methodCalled('setCategoryPermissionForOrigin', |
| 185 [primaryPattern, secondaryPattern, contentType, value]); | 185 [primaryPattern, secondaryPattern, contentType, value]); |
| 186 return Promise.resolve(); | 186 return Promise.resolve(); |
| 187 }, | 187 }, |
| 188 }; | 188 }; |
| OLD | NEW |