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

Unified Diff: chrome/browser/resources/settings/site_settings/site_details_permission.js

Issue 2021343003: MD Site Settings: Add five new top level categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback and add icons Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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..208d86c2cb564025a182c4446c9d54b20c7d3018 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.
+ * @param {string} left The first origin to compare.
+ * @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;
}

Powered by Google App Engine
This is Rietveld 408576698