OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 (function() { | 5 (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 cr.define('cr.translateInternals', function() { | 8 cr.define('cr.translateInternals', function() { |
9 | 9 |
10 var detectionLogs_ = null; | 10 var detectionLogs_ = null; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // This list is from chrome/common/translate/translate_errors.h. | 108 // This list is from chrome/common/translate/translate_errors.h. |
109 // If this header file is updated, the below list also should be updated. | 109 // If this header file is updated, the below list also should be updated. |
110 var errorStrs = { | 110 var errorStrs = { |
111 0: 'None', | 111 0: 'None', |
112 1: 'Network', | 112 1: 'Network', |
113 2: 'Initialization Error', | 113 2: 'Initialization Error', |
114 3: 'Unknown Language', | 114 3: 'Unknown Language', |
115 4: 'Unsupported Language', | 115 4: 'Unsupported Language', |
116 5: 'Identical Languages', | 116 5: 'Identical Languages', |
117 6: 'Translation Error', | 117 6: 'Translation Error', |
| 118 7: 'Translation Timeout', |
| 119 8: 'Unexpected Script Error', |
| 120 9: 'Bad Origin', |
| 121 10: 'Script Load Error', |
118 }; | 122 }; |
119 | 123 |
120 if (error < 0 || errorStrs.length <= error) { | 124 if (error < 0 || errorStrs.length <= error) { |
121 console.error('Invalid error code:', error); | 125 console.error('Invalid error code:', error); |
122 return 'Invalid Error Code'; | 126 return 'Invalid Error Code'; |
123 } | 127 } |
124 return errorStrs[error]; | 128 return errorStrs[error]; |
125 } | 129 } |
126 | 130 |
127 /** | 131 /** |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 /** | 428 /** |
425 * The entry point of the UI. | 429 * The entry point of the UI. |
426 */ | 430 */ |
427 function main() { | 431 function main() { |
428 cr.doc.addEventListener('DOMContentLoaded', | 432 cr.doc.addEventListener('DOMContentLoaded', |
429 cr.translateInternals.initialize); | 433 cr.translateInternals.initialize); |
430 } | 434 } |
431 | 435 |
432 main(); | 436 main(); |
433 })(); | 437 })(); |
OLD | NEW |