summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options/personal_options.js
blob: b8b21074acaba8d0f30298dd0e6b0969e236ca80 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2010 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.

//
// PersonalOptions class
// Encapsulated handling of personal options page.
//
function PersonalOptions() {
  OptionsPage.call(this, 'personal', templateData.personalPage, 'personalPage');
}

cr.addSingletonGetter(PersonalOptions);

PersonalOptions.prototype = {
  // Inherit PersonalOptions from OptionsPage.
  __proto__: OptionsPage.prototype,

  // Initialize PersonalOptions page.
  initializePage: function() {
    // Call base class implementation to starts preference initialization.
    OptionsPage.prototype.initializePage.call(this);


    // Listen to pref changes.
    Preferences.getInstance().addEventListener('sync.has_setup_completed',
        function(event) {
          if(event.value) {
            $('text-when-synced').style.display = 'block';
            $('button-when-synced').style.display = 'block';
          }
          else {
            $('text-when-not-synced').style.display = 'block';
            $('button-when-not-synced').style.display = 'block';
          }
        });

    $('sync-customize').onclick = function(event) {
      OptionsPage.showPageByName('sync');
    };

    $('showpasswords').onclick = function(event) {
      //TODO(sargrass): Show passwords dialog here.
    };

    $('autofill_options').onclick = function(event) {
      //TODO(sargrass): Show autofill dialog here.
    };

    $('import_data').onclick = function(event) {
      //TODO(sargrass): Show import_data dialog here.
    };

    if(navigator.platform.match(/linux|BSD/i)) {
      $('themes_GTK_button').onclick = function(event) {
        //TODO(sargrass): Show themes GTK dialog here.
      };

      $('themes_set_classic').onclick = function(event) {
        //TODO(sargrass): Show themes set classic dialog here.
      };
    }

    if(navigator.platform.match(/Mac|Win|CrOS/i)) {
      $('themes_reset').onclick = function(event) {
        //TODO(sargrass): Show themes reset dialog here.
      };
    }

  },
};