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

Side by Side Diff: chrome/browser/resources/settings/site_settings_page/site_settings_page.js

Issue 2131953002: Site Settings Desktop: Implement protocol handler section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-site-settings-page' is the settings page containing privacy and 7 * 'settings-site-settings-page' is the settings page containing privacy and
8 * security site settings. 8 * security site settings.
9 */ 9 */
10 Polymer({ 10 Polymer({
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 '#geolocation'); 45 '#geolocation');
46 this.setDefaultValue_(this.ContentSettingsTypes.IMAGES, '#images'); 46 this.setDefaultValue_(this.ContentSettingsTypes.IMAGES, '#images');
47 this.setDefaultValue_(this.ContentSettingsTypes.JAVASCRIPT, 47 this.setDefaultValue_(this.ContentSettingsTypes.JAVASCRIPT,
48 '#javascript'); 48 '#javascript');
49 this.setDefaultValue_(this.ContentSettingsTypes.KEYGEN, '#keygen'); 49 this.setDefaultValue_(this.ContentSettingsTypes.KEYGEN, '#keygen');
50 this.setDefaultValue_(this.ContentSettingsTypes.MIC, '#mic'); 50 this.setDefaultValue_(this.ContentSettingsTypes.MIC, '#mic');
51 this.setDefaultValue_(this.ContentSettingsTypes.NOTIFICATIONS, 51 this.setDefaultValue_(this.ContentSettingsTypes.NOTIFICATIONS,
52 '#notifications'); 52 '#notifications');
53 this.setDefaultValue_(this.ContentSettingsTypes.PLUGINS, '#plugins'); 53 this.setDefaultValue_(this.ContentSettingsTypes.PLUGINS, '#plugins');
54 this.setDefaultValue_(this.ContentSettingsTypes.POPUPS, '#popups'); 54 this.setDefaultValue_(this.ContentSettingsTypes.POPUPS, '#popups');
55 this.setDefaultValue_(this.ContentSettingsTypes.PROTOCOL_HANDLERS,
56 '#handlers');
55 this.setDefaultValue_(this.ContentSettingsTypes.UNSANDBOXED_PLUGINS, 57 this.setDefaultValue_(this.ContentSettingsTypes.UNSANDBOXED_PLUGINS,
56 '#unsandboxedPlugins'); 58 '#unsandboxedPlugins');
57 }, 59 },
58 60
59 setDefaultValue_: function(category, id) { 61 setDefaultValue_: function(category, id) {
60 this.browserProxy.getDefaultValueForContentType( 62 this.browserProxy.getDefaultValueForContentType(
61 category).then(function(enabled) { 63 category).then(function(enabled) {
62 var description = this.computeCategoryDesc(category, enabled, false); 64 var description = this.computeCategoryDesc(category, enabled, false);
63 this.$$(id).innerText = description; 65 this.$$(id).innerText = description;
64 }.bind(this)); 66 }.bind(this));
65 }, 67 },
66 68
67 /** 69 /**
68 * Handles selection of a single category and navigates to the details for 70 * Handles selection of a single category and navigates to the details for
69 * that category. 71 * that category.
70 * @param {!Event} event The tap event. 72 * @param {!Event} event The tap event.
71 */ 73 */
72 onTapCategory: function(event) { 74 onTapCategory: function(event) {
73 var category = event.currentTarget.getAttribute('category'); 75 var category = event.currentTarget.getAttribute('category');
74 if (category == settings.ALL_SITES) { 76 if (category == settings.ALL_SITES) {
75 this.currentRoute = { 77 this.currentRoute = {
76 page: this.currentRoute.page, 78 page: this.currentRoute.page,
77 section: 'privacy', 79 section: 'privacy',
78 subpage: ['site-settings', 'all-sites'], 80 subpage: ['site-settings', 'all-sites'],
79 }; 81 };
82 } else if (category == this.ContentSettingsTypes.PROTOCOL_HANDLERS) {
83 this.currentRoute = {
84 page: this.currentRoute.page,
85 section: 'privacy',
86 subpage: ['site-settings', 'protocol-handlers'],
87 };
80 } else { 88 } else {
81 this.categorySelected = this.computeCategoryTextId(category); 89 this.categorySelected = this.computeCategoryTextId(category);
82 this.currentRoute = { 90 this.currentRoute = {
83 page: this.currentRoute.page, 91 page: this.currentRoute.page,
84 section: 'privacy', 92 section: 'privacy',
85 subpage: ['site-settings', 'site-settings-category-' + 93 subpage: ['site-settings', 'site-settings-category-' +
86 this.categorySelected], 94 this.categorySelected],
87 }; 95 };
88 } 96 }
89 }, 97 },
90 }); 98 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698