| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 __gCrWeb['translate'] = {}; |
| 6 * @fileoverview Installs Translate management functions on the __gCrWeb object. | |
| 7 * | |
| 8 * TODO(crbug.com/659442): Enable checkTypes, checkVars errors for this file. | |
| 9 * @suppress {checkTypes, checkVars} | |
| 10 */ | |
| 11 | |
| 12 __gCrWeb.translate = {}; | |
| 13 | |
| 14 // Store translate namespace object in a global __gCrWeb object referenced by a | |
| 15 // string, so it does not get renamed by closure compiler during the | |
| 16 // minification. | |
| 17 __gCrWeb['translate'] = __gCrWeb.translate; | |
| 18 | 6 |
| 19 (function() { | 7 (function() { |
| 20 /** | 8 /** |
| 21 * The delay a wait performed (in milliseconds) before checking whether the | 9 * The delay a wait performed (in milliseconds) before checking whether the |
| 22 * translation has finished. | 10 * translation has finished. |
| 23 * @type {number} | 11 * @type {number} |
| 24 */ | 12 */ |
| 25 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY = 400; | 13 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY = 400; |
| 26 | 14 |
| 27 /** | 15 /** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 'originalPageLanguage': cr.googleTranslate.sourceLang, | 70 'originalPageLanguage': cr.googleTranslate.sourceLang, |
| 83 'translationTime': cr.googleTranslate.translationTime}); | 71 'translationTime': cr.googleTranslate.translationTime}); |
| 84 } else { | 72 } else { |
| 85 // The translation is still pending, check again later. | 73 // The translation is still pending, check again later. |
| 86 window.setTimeout(__gCrWeb.translate.checkTranslateStatus, | 74 window.setTimeout(__gCrWeb.translate.checkTranslateStatus, |
| 87 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY); | 75 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY); |
| 88 } | 76 } |
| 89 } | 77 } |
| 90 | 78 |
| 91 }()); // anonymous function | 79 }()); // anonymous function |
| OLD | NEW |