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

Side by Side Diff: chrome/browser/resources/options/content_settings.js

Issue 467363003: Guest mode causes certain settings to be hidden. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change visibility to CSS controlled Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var Page = cr.ui.pageManager.Page; 6 /** @const */ var Page = cr.ui.pageManager.Page;
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager; 7 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
8 8
9 ////////////////////////////////////////////////////////////////////////////// 9 //////////////////////////////////////////////////////////////////////////////
10 // ContentSettings class: 10 // ContentSettings class:
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 ContentSettings.setHandlers = function(handlers) { 177 ContentSettings.setHandlers = function(handlers) {
178 $('handlers-list').setHandlers(handlers); 178 $('handlers-list').setHandlers(handlers);
179 }; 179 };
180 180
181 ContentSettings.setIgnoredHandlers = function(ignoredHandlers) { 181 ContentSettings.setIgnoredHandlers = function(ignoredHandlers) {
182 $('ignored-handlers-list').setHandlers(ignoredHandlers); 182 $('ignored-handlers-list').setHandlers(ignoredHandlers);
183 }; 183 };
184 184
185 ContentSettings.setOTRExceptions = function(type, otrExceptions) { 185 ContentSettings.setOTRExceptions = function(type, otrExceptions) {
186 var exceptionsList = this.getExceptionsList(type, 'otr'); 186 var exceptionsList = this.getExceptionsList(type, 'otr');
187 exceptionsList.parentNode.hidden = false; 187 // Settings for Guest hides many sections, so check for null first.
188 exceptionsList.setExceptions(otrExceptions); 188 if (exceptionsList) {
189 exceptionsList.parentNode.hidden = false;
190 exceptionsList.setExceptions(otrExceptions);
191 }
189 }; 192 };
190 193
191 /** 194 /**
192 * @param {string} type The type of exceptions (e.g. "location") to get. 195 * @param {string} type The type of exceptions (e.g. "location") to get.
193 * @param {string} mode The mode of the desired exceptions list (e.g. otr). 196 * @param {string} mode The mode of the desired exceptions list (e.g. otr).
194 * @return {?ExceptionsList} The corresponding exceptions list or null. 197 * @return {?ExceptionsList} The corresponding exceptions list or null.
195 */ 198 */
196 ContentSettings.getExceptionsList = function(type, mode) { 199 ContentSettings.getExceptionsList = function(type, mode) {
197 return document.querySelector( 200 return document.querySelector(
198 'div[contentType=' + type + '] list[mode=' + mode + ']'); 201 'div[contentType=' + type + '] list[mode=' + mode + ']');
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 var deviceSelect = $('media-select-camera'); 304 var deviceSelect = $('media-select-camera');
302 chrome.send('setDefaultCaptureDevice', ['camera', deviceSelect.value]); 305 chrome.send('setDefaultCaptureDevice', ['camera', deviceSelect.value]);
303 }; 306 };
304 307
305 // Export 308 // Export
306 return { 309 return {
307 ContentSettings: ContentSettings 310 ContentSettings: ContentSettings
308 }; 311 };
309 312
310 }); 313 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698