| 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 __gCrWeb['translate'] = {}; | 5 /** |
| 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; |
| 6 | 18 |
| 7 (function() { | 19 (function() { |
| 8 /** | 20 /** |
| 9 * The delay a wait performed (in milliseconds) before checking whether the | 21 * The delay a wait performed (in milliseconds) before checking whether the |
| 10 * translation has finished. | 22 * translation has finished. |
| 11 * @type {number} | 23 * @type {number} |
| 12 */ | 24 */ |
| 13 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY = 400; | 25 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY = 400; |
| 14 | 26 |
| 15 /** | 27 /** |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 'originalPageLanguage': cr.googleTranslate.sourceLang, | 82 'originalPageLanguage': cr.googleTranslate.sourceLang, |
| 71 'translationTime': cr.googleTranslate.translationTime}); | 83 'translationTime': cr.googleTranslate.translationTime}); |
| 72 } else { | 84 } else { |
| 73 // The translation is still pending, check again later. | 85 // The translation is still pending, check again later. |
| 74 window.setTimeout(__gCrWeb.translate.checkTranslateStatus, | 86 window.setTimeout(__gCrWeb.translate.checkTranslateStatus, |
| 75 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY); | 87 __gCrWeb.translate.TRANSLATE_STATUS_CHECK_DELAY); |
| 76 } | 88 } |
| 77 } | 89 } |
| 78 | 90 |
| 79 }()); // anonymous function | 91 }()); // anonymous function |
| OLD | NEW |