ProjectingObserverChromeos: Drop DBusThreadManager dependency for better testing.
[chromium-blink-merge.git] / components / translate / core / common / translate_errors.h
blob7062fe3dba1ad33689ca4879679fbcda03a44097
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_TRANSLATE_CORE_COMMON_TRANSLATE_ERRORS_H_
6 #define COMPONENTS_TRANSLATE_CORE_COMMON_TRANSLATE_ERRORS_H_
8 #include "base/basictypes.h"
10 namespace translate {
12 // This file consolidates all the error types for translation of a page.
13 // Note: TranslateErrors is used for UMA and translate_internals.js.
14 // Assigned numbers should be changed because the number is binded to UMA value.
15 // enum TranslateError in histograms.xml and errorStrs in translate_internals.js
16 // should be updated when the type is updated.
18 class TranslateErrors {
19 public:
20 enum Type {
21 NONE = 0,
22 NETWORK, // No connectivity.
23 INITIALIZATION_ERROR, // The translation script failed to initialize.
24 UNKNOWN_LANGUAGE, // The page's language could not be detected.
25 UNSUPPORTED_LANGUAGE, // The server detected a language that the browser
26 // does not know.
27 IDENTICAL_LANGUAGES, // The original and target languages are the same.
28 TRANSLATION_ERROR, // An error was reported by the translation script
29 // during translation.
30 TRANSLATION_TIMEOUT, // The library doesn't finish the translation.
31 UNEXPECTED_SCRIPT_ERROR, // The library raises an unexpected exception.
32 BAD_ORIGIN, // The library is blocked because of bad origin.
33 SCRIPT_LOAD_ERROR, // Loader fails to load a dependent JavaScript.
34 TRANSLATE_ERROR_MAX,
37 private:
38 TranslateErrors() {}
40 DISALLOW_COPY_AND_ASSIGN(TranslateErrors);
43 } // namespace translate
45 #endif // COMPONENTS_TRANSLATE_CORE_COMMON_TRANSLATE_ERRORS_H_