Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/resources/translate_internals/translate_internals.js

Issue 24024004: Translate: element API callback interface change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits found by local test... Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/translate.js ('k') | chrome/common/translate/translate_errors.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/translate.js ('k') | chrome/common/translate/translate_errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698