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 Behavior common to Site Settings classes. | 6 * @fileoverview Behavior common to Site Settings classes. |
7 */ | 7 */ |
8 | 8 |
9 /** @polymerBehavior */ | 9 /** @polymerBehavior */ |
10 var SiteSettingsBehaviorImpl = { | 10 var SiteSettingsBehaviorImpl = { |
11 properties: { | 11 properties: { |
12 /** | 12 /** |
13 * The string ID of the category this element is displaying data for. | 13 * The string ID of the category this element is displaying data for. |
14 * See site_settings/constants.js for possible values. | 14 * See site_settings/constants.js for possible values. |
| 15 * @type {!settings.ContentSettingsTypes} |
15 */ | 16 */ |
16 category: String, | 17 category: String, |
17 | 18 |
18 /** | 19 /** |
19 * The browser proxy used to retrieve and change information about site | 20 * The browser proxy used to retrieve and change information about site |
20 * settings categories and the sites within. | 21 * settings categories and the sites within. |
21 * @type {settings.SiteSettingsPrefsBrowserProxy} | 22 * @type {settings.SiteSettingsPrefsBrowserProxy} |
22 */ | 23 */ |
23 browserProxy: Object, | 24 browserProxy: Object, |
24 }, | 25 }, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // that during the sort. The URL generation should be wrapped in a try/catch | 140 // that during the sort. The URL generation should be wrapped in a try/catch |
140 // as well. | 141 // as well. |
141 originOrPattern = originOrPattern.replace('*://', ''); | 142 originOrPattern = originOrPattern.replace('*://', ''); |
142 originOrPattern = originOrPattern.replace('[*.]', ''); | 143 originOrPattern = originOrPattern.replace('[*.]', ''); |
143 return new URL(this.ensureUrlHasScheme(originOrPattern)); | 144 return new URL(this.ensureUrlHasScheme(originOrPattern)); |
144 }, | 145 }, |
145 | 146 |
146 /** | 147 /** |
147 * Convert an exception (received from the C++ handler) to a full | 148 * Convert an exception (received from the C++ handler) to a full |
148 * SiteException. | 149 * SiteException. |
149 * @param {!Object} exception The raw site exception from C++. | 150 * @param {!RawSiteException} exception The raw site exception from C++. |
150 * @return {SiteException} The expanded (full) SiteException. | 151 * @return {SiteException} The expanded (full) SiteException. |
151 * @private | 152 * @private |
152 */ | 153 */ |
153 expandSiteException: function(exception) { | 154 expandSiteException: function(exception) { |
154 var origin = exception.origin; | 155 var origin = exception.origin; |
155 var embeddingOrigin = exception.embeddingOrigin; | 156 var embeddingOrigin = exception.embeddingOrigin; |
156 var embeddingDisplayName = ''; | 157 var embeddingDisplayName = ''; |
157 if (origin != embeddingOrigin) { | 158 if (origin != embeddingOrigin) { |
158 embeddingDisplayName = | 159 embeddingDisplayName = |
159 this.getEmbedderString(embeddingOrigin, this.category); | 160 this.getEmbedderString(embeddingOrigin, this.category); |
160 } | 161 } |
161 | 162 |
162 return { | 163 return { |
163 category: this.category, | 164 category: this.category, |
164 origin: origin, | 165 origin: origin, |
165 displayName: exception.displayName, | 166 displayName: exception.displayName, |
166 embeddingOrigin: embeddingOrigin, | 167 embeddingOrigin: embeddingOrigin, |
167 embeddingDisplayName: embeddingDisplayName, | 168 embeddingDisplayName: embeddingDisplayName, |
168 incognito: exception.incognito, | 169 incognito: exception.incognito, |
169 setting: exception.setting, | 170 setting: exception.setting, |
170 source: exception.source, | 171 source: exception.source, |
171 }; | 172 }; |
172 }, | 173 }, |
173 | 174 |
174 }; | 175 }; |
175 | 176 |
176 /** @polymerBehavior */ | 177 /** @polymerBehavior */ |
177 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; | 178 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; |
OLD | NEW |