| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 /** @return {!Promise} */ | 5 /** @return {!Promise} */ |
| 6 function getUiHandler() { | 6 function getUiHandler() { |
| 7 return new Promise(function(resolve, reject) { | 7 return new Promise(function(resolve, reject) { |
| 8 define([ | 8 define([ |
| 9 'mojo/public/js/connection', | 9 'mojo/public/js/connection', |
| 10 'components/version_ui/version.mojom', | 10 'components/version_ui/version.mojom', |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return new Promise(function(resolve, reject) { | 26 return new Promise(function(resolve, reject) { |
| 27 document.addEventListener('DOMContentLoaded', resolve); | 27 document.addEventListener('DOMContentLoaded', resolve); |
| 28 }); | 28 }); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function main() { | 31 function main() { |
| 32 Promise.all([ | 32 Promise.all([ |
| 33 whenDomContentLoaded(), getUiHandler() | 33 whenDomContentLoaded(), getUiHandler() |
| 34 ]).then(function(results) { | 34 ]).then(function(results) { |
| 35 var uiHandler = results[1]; | 35 var uiHandler = results[1]; |
| 36 uiHandler.getFilePaths().then(function(response) { | 36 if (!cr.isIOS) { |
| 37 $('executable_path').textContent = response.execPath; | 37 uiHandler.getFilePaths().then(function(response) { |
| 38 $('profile_path').textContent = response.profilePath; | 38 $('executable_path').textContent = response.execPath; |
| 39 }); | 39 $('profile_path').textContent = response.profilePath; |
| 40 }); |
| 41 } |
| 40 uiHandler.getVariations().then(function(response) { | 42 uiHandler.getVariations().then(function(response) { |
| 41 $('variations-section').hidden = response.variations.length == 0; | 43 $('variations-section').hidden = response.variations.length == 0; |
| 42 $('variations-list').appendChild( | 44 $('variations-list').appendChild( |
| 43 parseHtmlSubset(response.variations.join('<br>'), ['BR'])); | 45 parseHtmlSubset(response.variations.join('<br>'), ['BR'])); |
| 44 }); | 46 }); |
| 45 | 47 |
| 46 if (!cr.isAndroid) { | 48 if (!cr.isAndroid && !cr.isIOS) { |
| 47 uiHandler.getFlashVersion().then(function(response) { | 49 uiHandler.getFlashVersion().then(function(response) { |
| 48 $('flash_version').textContent = response.flashVersion; | 50 $('flash_version').textContent = response.flashVersion; |
| 49 }); | 51 }); |
| 50 } | 52 } |
| 51 | 53 |
| 52 if (cr.isChromeOS) { | 54 if (cr.isChromeOS) { |
| 53 uiHandler.getOsVersion().then(function(response) { | 55 uiHandler.getOsVersion().then(function(response) { |
| 54 $('os_version').textContent = response.osVersion; | 56 $('os_version').textContent = response.osVersion; |
| 55 }); | 57 }); |
| 56 uiHandler.getArcVersion().then(function(response) { | 58 uiHandler.getArcVersion().then(function(response) { |
| 57 $('arc_version').textContent = response.arcVersion; | 59 $('arc_version').textContent = response.arcVersion; |
| 58 $('arc_holder').hidden = !response.arcVersion; | 60 $('arc_holder').hidden = !response.arcVersion; |
| 59 }); | 61 }); |
| 60 } | 62 } |
| 61 }); | 63 }); |
| 62 } | 64 } |
| 63 main(); | 65 main(); |
| OLD | NEW |