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

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

Issue 1546993003: Site Settings: Give each category its own route. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback and add some tests Created 4 years, 11 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_settings_category.js
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_category.js b/chrome/browser/resources/settings/site_settings/site_settings_category.js
index 01b764c709e7768fc15c66762547c27bbac9b9b4..97f25d17851c3ccec8f91d281440d59e1b704aad 100644
--- a/chrome/browser/resources/settings/site_settings/site_settings_category.js
+++ b/chrome/browser/resources/settings/site_settings/site_settings_category.js
@@ -62,11 +62,16 @@ Polymer({
],
ready: function() {
- // TODO(finnur): Handle dynamic routes, so that we can link directly into
- // individual categories without having to first stop by the site settings
- // page to select a category.
this.$.blockList.categorySubtype = settings.PermissionValues.BLOCK;
this.$.allowList.categorySubtype = settings.PermissionValues.ALLOW;
+
+ // See if the URL contains a specific category (only happens if the user
+ // navigates directly to the category page).
+ var urlParts = window.location.href.split('/');
+ var categoryTextId = urlParts[urlParts.length - 1];
+ var category = this.computeCategoryFromTextId(categoryTextId);
+ if (category != -1)
+ this.category = category;
},
/**
@@ -84,7 +89,7 @@ Polymer({
settings.PermissionValues.ALLOW :
settings.PermissionValues.BLOCK);
break;
- case settings.ContentSettingsTypes.NOTIFICATION:
+ case settings.ContentSettingsTypes.NOTIFICATIONS:
case settings.ContentSettingsTypes.GEOLOCATION:
case settings.ContentSettingsTypes.CAMERA:
case settings.ContentSettingsTypes.MIC:

Powered by Google App Engine
This is Rietveld 408576698