Home | History | Annotate | Download | only in options
      1 // Copyright 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 (function() {
      6   if (document.location != 'chrome://settings-frame/options_settings_app.html')
      7     return;
      8 
      9   OptionsPage.setIsSettingsApp();
     10 
     11   // Override the offset in the options page.
     12   OptionsPage.setHorizontalOffset(38);
     13 
     14   document.addEventListener('DOMContentLoaded', function() {
     15     // Hide everything by default.
     16     var sections = document.querySelectorAll('section');
     17     for (var i = 0; i < sections.length; i++)
     18       sections[i].hidden = true;
     19 
     20     var whitelistedSections = [
     21       'advanced-settings',
     22       'downloads-section',
     23       'handlers-section',
     24       'languages-section',
     25       'media-galleries-section',
     26       'network-section',
     27       'notifications-section',
     28       'sync-section'
     29     ];
     30 
     31     for (var i = 0; i < whitelistedSections.length; i++)
     32       $(whitelistedSections[i]).hidden = false;
     33 
     34     // Avoid showing an empty Users section on ash. Note that profiles-section
     35     // is actually a div element, rather than section, so is not hidden after
     36     // the querySelectorAll(), above.
     37     $('sync-users-section').hidden = $('profiles-section').hidden;
     38 
     39     // Hide Import bookmarks and settings button.
     40     $('import-data').hidden = true;
     41 
     42     // Hide create / edit / delete profile buttons.
     43     $('profiles-create').hidden = true;
     44     $('profiles-delete').hidden = true;
     45     $('profiles-manage').hidden = true;
     46 
     47     // Remove the 'X'es on profiles in the profile list.
     48     $('profiles-list').canDeleteItems = false;
     49   });
     50 
     51   loadTimeData.overrideValues(loadTimeData.getValue('settingsApp'));
     52 }());
     53