Chromium Code Reviews| 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..606254aac7681b65945b85842e5269f8cc35fa0e 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 displayName = urlParts[urlParts.length - 1]; |
| + var category = this.computeCategoryFromDisplayName(displayName); |
|
tommycli
2016/01/04 18:12:09
same comment as before regarding display name
Finnur
2016/01/05 15:54:07
You prefer that to be named computeCategoryFromUrl
tommycli
2016/01/05 18:28:58
Actually I think this code is probably just unneed
|
| + if (category != -1) |
| + this.category = category; |
|
tommycli
2016/01/04 18:12:09
setting this.category using the final part of the
Finnur
2016/01/05 15:54:07
I am already doing that (setting the category), th
tommycli
2016/01/05 18:28:58
Oh I see.
If you define the routes as suggested i
|
| }, |
| /** |
| @@ -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: |