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
3 // found in the LICENSE file.
6 // Contains all the necessary functions for rendering the Welcome page on
9 cr
.define('welcome', function() {
12 function initialize() {
13 // Disable context menus.
14 document
.body
.oncontextmenu = function(e
) {
18 $('settings').onclick = function() {
19 chrome
.send('showSyncSettings');
22 var tosLink
= $('tos-link');
24 tosLink
.onclick = function() {
25 chrome
.send('showTermsOfService');
29 // Set visibility of terms of service footer.
30 $('tos-footer').hidden
= !loadTimeData
.getBoolean('tosVisible');
32 // Set the initial visibility for the sync footer.
33 chrome
.send('updateSyncFooterVisibility');
37 * Sets the visibility of the sync footer.
38 * @param {boolean} isVisible Whether the sync footer should be visible.
40 function setSyncFooterVisible(isVisible
) {
41 $('sync-footer').hidden
= !isVisible
;
44 // Return an object with all of the exports.
46 initialize
: initialize
,
47 setSyncFooterVisible
: setSyncFooterVisible
,
51 document
.addEventListener('DOMContentLoaded', welcome
.initialize
);