// 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.

///////////////////////////////////////////////////////////////////////////////
// SystemOptions class:

/**
 * Encapsulated handling of ChromeOS system options page.
 * @constructor
 */
function SystemOptions(model) {
  OptionsPage.call(this, 'system', templateData.systemPage, 'systemPage');
}

SystemOptions.getInstance = function() {
  if (SystemOptions.instance_)
    return SystemOptions.instance_;
  SystemOptions.instance_ = new SystemOptions(null);
  return SystemOptions.instance_;
}

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

  /**
   * Initializes SystemOptions page.
   * Calls base class implementation to starts preference initialization.
   */
  initializePage: function() {
    OptionsPage.prototype.initializePage.call(this);
    var timezone = $('timezone-select');
    if (timezone) {
      timezone.initializeValues(templateData.timezoneList);
    }

    $('language-button').onclick = function(event) {
      // TODO: Open ChromeOS language settings page.
    };
    $('sync-button').onclick = function(event) {
      OptionsPage.showPageByName('sync');
    }
    $('dummy-button').onclick = function(event) {
      OptionsPage.showOverlay('dummy');
    }
  },
};

// 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.

///////////////////////////////////////////////////////////////////////////////
// SystemOptions class:

/**
 * Encapsulated handling of ChromeOS system options page.
 * @constructor
 */
function SystemOptions(model) {
  OptionsPage.call(this, 'system', templateData.systemPage, 'systemPage');
}

SystemOptions.getInstance = function() {
  if (SystemOptions.instance_)
    return SystemOptions.instance_;
  SystemOptions.instance_ = new SystemOptions(null);
  return SystemOptions.instance_;
}

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

  /**
   * Initializes SystemOptions page.
   * Calls base class implementation to starts preference initialization.
   */
  initializePage: function() {
    OptionsPage.prototype.initializePage.call(this);
    var timezone = $('timezone-select');
    if (timezone) {
      timezone.initializeValues(templateData.timezoneList);
    }

    $('language-button').onclick = function(event) {
      // TODO: Open ChromeOS language settings page.
    };
  },
};

Fix runtime JavaScript errors in chrome://options.
Fix runtime JavaScript errors in chrome://options.

With chrome built with CHROMEOS=1, the following error occurs
in in chrome://options as sync-button and dummy-button don't exist.
Remove the binding code to fix the error.

[28843:28843:611993994873:INFO:CONSOLE(0)] "Uncaught TypeError: Cannot set property 'onclick' of null," source: chrome://options/system (528)

TEST=manually on ubuntu by "out/Release/chrome --test-type"
BUG=none

Review URL: http://codereview.chromium.org/2900008

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@52281 0039d316-1c4b-4281-b951-d872f2087c98
