Index: chrome/browser/resources/settings/site_settings/site_details_permission.js |
diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chrome/browser/resources/settings/site_settings/site_details_permission.js |
index 7ac2f6f59281401bb858847eb0975ea8da5f675f..b134217ab58f099b3fb71c5c43a4a50309780199 100644 |
--- a/chrome/browser/resources/settings/site_settings/site_details_permission.js |
+++ b/chrome/browser/resources/settings/site_settings/site_details_permission.js |
@@ -41,6 +41,19 @@ Polymer({ |
}, |
/** |
+ * Returns true if the origins match (e.g. http://google.com and |
+ * http://[*.]google.com. |
michaelpg
2016/06/03 13:37:14
nit: closing paren (or if parens and wildcards don
Finnur
2016/06/03 19:58:06
Done.
|
+ * @param {!string} left The first origin to compare. |
michaelpg
2016/06/03 13:37:14
nit here & below: by default strings are non-nulla
Finnur
2016/06/03 19:58:06
Dang. Keep forgetting. :)
|
+ * @param {!string} right The second origin to compare. |
+ * @return {boolean} True if the origins are the same. |
+ * @private |
+ */ |
+ sameOrigin_: function(left, right) { |
+ return this.removePatternWildcard_(left) == |
+ this.removePatternWildcard_(right); |
+ }, |
+ |
+ /** |
* Sets the site to display. |
* @param {!SiteException} site The site to display. |
* @private |
@@ -51,7 +64,7 @@ Polymer({ |
this.browserProxy.getExceptionList(this.category).then( |
function(exceptionList) { |
for (var i = 0; i < exceptionList.length; ++i) { |
- if (exceptionList[i].origin == site.origin) { |
+ if (this.sameOrigin_(exceptionList[i].origin, site.origin)) { |
this.$.permission.selected = exceptionList[i].setting; |
this.$.details.hidden = false; |
} |