Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_settings_behavior.js

Issue 2760183002: [MD setting] separate RawSiteException and SiteException (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.
dpapad 2017/03/21 01:04:22 Could this be changed to better reflect the possib
dschuyler 2017/03/22 01:35:41 Done.
15 */ 15 */
16 category: String, 16 category: String,
17 17
18 /** 18 /**
19 * The browser proxy used to retrieve and change information about site 19 * The browser proxy used to retrieve and change information about site
20 * settings categories and the sites within. 20 * settings categories and the sites within.
21 * @type {settings.SiteSettingsPrefsBrowserProxy} 21 * @type {settings.SiteSettingsPrefsBrowserProxy}
22 */ 22 */
23 browserProxy: Object, 23 browserProxy: Object,
24 }, 24 },
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // that during the sort. The URL generation should be wrapped in a try/catch 139 // that during the sort. The URL generation should be wrapped in a try/catch
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 {!RawSiteException} exception The raw site exception from C++.
150 * @return {SiteException} The expanded (full) SiteException. 150 * @return {SiteException} The expanded (full) SiteException.
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 category: this.category,
164 origin: origin, 164 origin: origin,
165 displayName: exception.displayName, 165 displayName: exception.displayName,
166 embeddingOrigin: embeddingOrigin, 166 embeddingOrigin: embeddingOrigin,
167 embeddingDisplayName: embeddingDisplayName, 167 embeddingDisplayName: embeddingDisplayName,
168 incognito: exception.incognito, 168 incognito: exception.incognito,
169 setting: exception.setting, 169 setting: exception.setting,
170 source: exception.source, 170 source: exception.source,
171 }; 171 };
172 }, 172 },
173 173
174 }; 174 };
175 175
176 /** @polymerBehavior */ 176 /** @polymerBehavior */
177 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; 177 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698