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

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: Polish Created 5 years 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..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:

Powered by Google App Engine
This is Rietveld 408576698