1 // Copyright (c) 2011 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 var OptionsPage = options.OptionsPage; 6 var Preferences = options.Preferences; 7 var ProxyOptions = options.ProxyOptions; 8 9 /** 10 * DOMContentLoaded handler, sets up the page. 11 */ 12 function load() { 13 localStrings = new LocalStrings(); 14 15 if (cr.isChromeOS) 16 document.documentElement.setAttribute('os', 'chromeos'); 17 18 // Decorate the existing elements in the document. 19 cr.ui.decorate('input[pref][type=checkbox]', options.PrefCheckbox); 20 cr.ui.decorate('input[pref][type=number]', options.PrefNumber); 21 cr.ui.decorate('input[pref][type=radio]', options.PrefRadio); 22 cr.ui.decorate('input[pref][type=range]', options.PrefRange); 23 cr.ui.decorate('select[pref]', options.PrefSelect); 24 cr.ui.decorate('input[pref][type=text]', options.PrefTextField); 25 cr.ui.decorate('input[pref][type=url]', options.PrefTextField); 26 ProxyOptions.getInstance().initializePage(); 27 28 Preferences.getInstance().initialize(); 29 chrome.send('coreOptionsInitialize'); 30 31 ProxyOptions.getInstance().visible = true; 32 } 33 34 document.addEventListener('DOMContentLoaded', load); 35 36