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 = { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 // as well. | 140 // as well. |
141 originOrPattern = originOrPattern.replace('*://', ''); | 141 originOrPattern = originOrPattern.replace('*://', ''); |
142 originOrPattern = originOrPattern.replace('[*.]', ''); | 142 originOrPattern = originOrPattern.replace('[*.]', ''); |
143 return new URL(this.ensureUrlHasScheme(originOrPattern)); | 143 return new URL(this.ensureUrlHasScheme(originOrPattern)); |
144 }, | 144 }, |
145 | 145 |
146 /** | 146 /** |
147 * Convert an exception (received from the C++ handler) to a full | 147 * Convert an exception (received from the C++ handler) to a full |
148 * SiteException. | 148 * SiteException. |
149 * @param {!Object} exception The raw site exception from C++. | 149 * @param {!Object} exception The raw site exception from C++. |
150 * @return {SiteException} The expanded (full) SiteException. | 150 * @return {SiteException} The expanded (full) SiteException. |
dpapad
2017/03/20 22:22:47
SiteException typedef does not have a |category| f
dschuyler
2017/03/21 00:12:58
I made a CL at https://codereview.chromium.org/276
| |
151 * @private | 151 * @private |
152 */ | 152 */ |
153 expandSiteException: function(exception) { | 153 expandSiteException: function(exception) { |
154 var origin = exception.origin; | 154 var origin = exception.origin; |
155 var embeddingOrigin = exception.embeddingOrigin; | 155 var embeddingOrigin = exception.embeddingOrigin; |
156 var embeddingDisplayName = ''; | 156 var embeddingDisplayName = ''; |
157 if (origin != embeddingOrigin) { | 157 if (origin != embeddingOrigin) { |
158 embeddingDisplayName = | 158 embeddingDisplayName = |
159 this.getEmbedderString(embeddingOrigin, this.category); | 159 this.getEmbedderString(embeddingOrigin, this.category); |
160 } | 160 } |
161 | 161 |
162 return { | 162 return { |
163 category: this.category, | |
163 origin: origin, | 164 origin: origin, |
164 displayName: exception.displayName, | 165 displayName: exception.displayName, |
165 embeddingOrigin: embeddingOrigin, | 166 embeddingOrigin: embeddingOrigin, |
166 embeddingDisplayName: embeddingDisplayName, | 167 embeddingDisplayName: embeddingDisplayName, |
167 incognito: exception.incognito, | 168 incognito: exception.incognito, |
168 setting: exception.setting, | 169 setting: exception.setting, |
169 source: exception.source, | 170 source: exception.source, |
170 }; | 171 }; |
171 }, | 172 }, |
172 | 173 |
173 }; | 174 }; |
174 | 175 |
175 /** @polymerBehavior */ | 176 /** @polymerBehavior */ |
176 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; | 177 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; |
OLD | NEW |