summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/options_settings_app.js
blob: 7c8bf37bb8b065a6a7a628b2599e7d632ca5536d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

(function() {
  if (document.location != 'chrome://settings-frame/options_settings_app.html')
    return;

  OptionsPage.setIsSettingsApp();

  // Override the offset in the options page.
  OptionsPage.setHorizontalOffset(38);

  document.addEventListener('DOMContentLoaded', function() {
    // Hide everything by default.
    var sections = document.querySelectorAll('section');
    for (var i = 0; i < sections.length; i++)
      sections[i].hidden = true;

    var whitelistedSections = [
      'advanced-settings',
      'downloads-section',
      'handlers-section',
      'languages-section',
      'media-galleries-section',
      'network-section',
      'notifications-section',
      'sync-section',
      'sync-users-section'
    ];

    for (var i = 0; i < whitelistedSections.length; i++)
      $(whitelistedSections[i]).hidden = false;

    // Hide Import bookmarks and settings button.
    $('import-data').hidden = true;

    // Hide create / edit / delete profile buttons.
    $('profiles-create').hidden = true;
    $('profiles-delete').hidden = true;
    $('profiles-manage').hidden = true;

    // Remove the 'X'es on profiles in the profile list.
    $('profiles-list').canDeleteItems = false;
  });

  loadTimeData.overrideValues(loadTimeData.getValue('settingsApp'));
}());