| Index: components/translate/content/common/translate.mojom
|
| diff --git a/components/translate/content/common/translate.mojom b/components/translate/content/common/translate.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..21d9c212629b12bb39cf68763851b413b10739e3
|
| --- /dev/null
|
| +++ b/components/translate/content/common/translate.mojom
|
| @@ -0,0 +1,63 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +module translate.mojom;
|
| +
|
| +import "mojo/common/common_custom_types.mojom";
|
| +import "url/mojo/url.mojom";
|
| +
|
| +// enum translate::TranslateErrors::Type
|
| +enum TranslateErrorsType {
|
| + NONE,
|
| + NETWORK,
|
| + INITIALIZATION_ERROR,
|
| + UNKNOWN_LANGUAGE,
|
| + UNSUPPORTED_LANGUAGE,
|
| + IDENTICAL_LANGUAGES,
|
| + TRANSLATION_ERROR,
|
| + TRANSLATION_TIMEOUT,
|
| + UNEXPECTED_SCRIPT_ERROR,
|
| + BAD_ORIGIN,
|
| + SCRIPT_LOAD_ERROR,
|
| +};
|
| +
|
| +// struct translate::LanguageDetectionDetails
|
| +struct LanguageDetectionDetails {
|
| + mojo.common.mojom.Time time;
|
| + url.mojom.Url url;
|
| + string content_language;
|
| + string cld_language;
|
| + bool is_cld_reliable;
|
| + bool has_notranslate;
|
| + string html_root_language;
|
| + string adopted_language;
|
| + string contents;
|
| +};
|
| +
|
| +interface TranslateHelper {
|
| + // Tells the renderer to translate the page contents from one language to
|
| + // another.
|
| + TranslatePage(int32 page_seq_no,
|
| + string translate_script,
|
| + string source_lang,
|
| + string target_lang);
|
| +
|
| + // Tells the renderer to revert the text of translated page to its original
|
| + // contents.
|
| + RevertTranslation(int32 page_seq_no);
|
| +};
|
| +
|
| +interface ContentTranslateDriver {
|
| + // Notification that the current page was assigned a sequence number.
|
| + TranslateAssignedSequenceNumber(int32 page_seq_no);
|
| +
|
| + // Notification that the language for the tab has been determined.
|
| + TranslateLanguageDetermined(LanguageDetectionDetails,
|
| + bool page_needs_translation);
|
| +
|
| + // Notifies the browser that a page has been translated.
|
| + PageTranslated(string original_lang,
|
| + string translated_lang,
|
| + TranslateErrorsType error_type);
|
| +};
|
|
|