| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 | 6 |
| 7 cr.define('help_page', function() { | 7 cr.define('help_page', function() { |
| 8 var localStrings = new LocalStrings(); | 8 var localStrings = new LocalStrings(); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 if (productTOS) | 33 if (productTOS) |
| 34 productTOS.innerHTML = localStrings.getString('productTOS'); | 34 productTOS.innerHTML = localStrings.getString('productTOS'); |
| 35 | 35 |
| 36 if (!cr.isLinux) { | 36 if (!cr.isLinux) { |
| 37 $('relaunch').onclick = function() { | 37 $('relaunch').onclick = function() { |
| 38 chrome.send('relaunchNow'); | 38 chrome.send('relaunchNow'); |
| 39 }; | 39 }; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Attempt to update. | 42 // Attempt to update. |
| 43 chrome.send('checkForUpdate'); | 43 chrome.send('onPageLoaded'); |
| 44 }, | 44 }, |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * @private | 47 * @private |
| 48 */ | 48 */ |
| 49 setUpdateImage_: function(state) { | 49 setUpdateImage_: function(state) { |
| 50 $('update-status-icon').className = 'update-icon ' + state; | 50 $('update-status-icon').className = 'update-icon ' + state; |
| 51 }, | 51 }, |
| 52 | 52 |
| 53 /** | 53 /** |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 $('update-percentage').hidden = status != 'updating'; | 73 $('update-percentage').hidden = status != 'updating'; |
| 74 $('relaunch').hidden = status != 'nearly_updated'; | 74 $('relaunch').hidden = status != 'nearly_updated'; |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * @private | 78 * @private |
| 79 */ | 79 */ |
| 80 setProgress_: function(progress) { | 80 setProgress_: function(progress) { |
| 81 $('update-percentage').innerHTML = progress + "%"; | 81 $('update-percentage').innerHTML = progress + "%"; |
| 82 } | 82 }, |
| 83 |
| 84 /** |
| 85 * @private |
| 86 */ |
| 87 setOSVersion_: function(version) { |
| 88 if (!cr.isChromeOS) |
| 89 console.error('OS version unsupported on non-CrOS'); |
| 90 |
| 91 $('os-version').textContent = version; |
| 92 }, |
| 93 |
| 94 /** |
| 95 * @private |
| 96 */ |
| 97 setOSFirmware_: function(firmware) { |
| 98 if (!cr.isChromeOS) |
| 99 console.error('OS firmware unsupported on non-CrOS'); |
| 100 |
| 101 $('firmware').textContent = firmware; |
| 102 }, |
| 83 }; | 103 }; |
| 84 | 104 |
| 85 HelpPage.setUpdateStatus = function(status) { | 105 HelpPage.setUpdateStatus = function(status) { |
| 86 HelpPage.getInstance().setUpdateStatus_(status); | 106 HelpPage.getInstance().setUpdateStatus_(status); |
| 87 }; | 107 }; |
| 88 | 108 |
| 89 HelpPage.setProgress = function(progress) { | 109 HelpPage.setProgress = function(progress) { |
| 90 HelpPage.getInstance().setProgress_(progress); | 110 HelpPage.getInstance().setProgress_(progress); |
| 91 }; | 111 }; |
| 92 | 112 |
| 113 HelpPage.setOSVersion = function(version) { |
| 114 HelpPage.getInstance().setOSVersion_(version); |
| 115 }; |
| 116 |
| 117 HelpPage.setOSFirmware = function(firmware) { |
| 118 HelpPage.getInstance().setOSFirmware_(firmware); |
| 119 }; |
| 120 |
| 93 // Export | 121 // Export |
| 94 return { | 122 return { |
| 95 HelpPage: HelpPage | 123 HelpPage: HelpPage |
| 96 }; | 124 }; |
| 97 }); | 125 }); |
| 98 | 126 |
| 99 var HelpPage = help_page.HelpPage; | 127 var HelpPage = help_page.HelpPage; |
| 100 | 128 |
| 101 window.onload = function() { | 129 window.onload = function() { |
| 102 HelpPage.getInstance().initialize(); | 130 HelpPage.getInstance().initialize(); |
| 103 }; | 131 }; |
| OLD | NEW |