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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_COMMON_TRANSLATE_TRANSLATE_ERRORS_H_ 6 #define CHROME_COMMON_TRANSLATE_TRANSLATE_ERRORS_H_ 7 8 // This file consolidates all the error types for translation of a page. 9 // Note: TranslateErrors is used for UMA and translate_internals.js. 10 // enum TranslateError in histograms.xml and errorStrs in translate_internals.js 11 // should be updated when the type is updated. 12 13 class TranslateErrors { 14 public: 15 enum Type { 16 NONE = 0, 17 NETWORK, // No connectivity. 18 INITIALIZATION_ERROR, // The translation script failed to initialize. 19 UNKNOWN_LANGUAGE, // The page's language could not be detected. 20 UNSUPPORTED_LANGUAGE, // The server detected a language that the browser 21 // does not know. 22 IDENTICAL_LANGUAGES, // The original and target languages are the same. 23 TRANSLATION_ERROR, // An error was reported by the translation script 24 // during translation. 25 TRANSLATE_ERROR_MAX, 26 }; 27 28 private: 29 TranslateErrors() {} 30 31 DISALLOW_COPY_AND_ASSIGN(TranslateErrors); 32 }; 33 34 #endif // CHROME_COMMON_TRANSLATE_TRANSLATE_ERRORS_H_ 35