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

Side by Side Diff: components/translate/content/common/translate.mojom

Issue 2066483004: [Wait to be closed] [Translate] Migrate IPCs to Mojo interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 module translate.mojom;
6
7 import "mojo/common/common_custom_types.mojom";
8 import "url/mojo/url.mojom";
9
10 // enum translate::TranslateErrors::Type
11 enum TranslateErrorsType {
12 NONE,
13 NETWORK,
14 INITIALIZATION_ERROR,
15 UNKNOWN_LANGUAGE,
16 UNSUPPORTED_LANGUAGE,
17 IDENTICAL_LANGUAGES,
18 TRANSLATION_ERROR,
19 TRANSLATION_TIMEOUT,
20 UNEXPECTED_SCRIPT_ERROR,
21 BAD_ORIGIN,
22 SCRIPT_LOAD_ERROR,
23 };
24
25 // struct translate::LanguageDetectionDetails
26 struct LanguageDetectionDetails {
27 mojo.common.mojom.Time time;
28 url.mojom.Url url;
29 string content_language;
30 string cld_language;
31 bool is_cld_reliable;
32 bool has_notranslate;
33 string html_root_language;
34 string adopted_language;
35 string contents;
36 };
37
38 interface TranslateHelper {
39 // Tells the renderer to translate the page contents from one language to
40 // another.
41 TranslatePage(int32 page_seq_no,
42 string translate_script,
43 string source_lang,
44 string target_lang);
45
46 // Tells the renderer to revert the text of translated page to its original
47 // contents.
48 RevertTranslation(int32 page_seq_no);
49 };
50
51 interface ContentTranslateDriver {
52 // Notification that the current page was assigned a sequence number.
53 TranslateAssignedSequenceNumber(int32 page_seq_no);
54
55 // Notification that the language for the tab has been determined.
56 TranslateLanguageDetermined(LanguageDetectionDetails,
57 bool page_needs_translation);
58
59 // Notifies the browser that a page has been translated.
60 PageTranslated(string original_lang,
61 string translated_lang,
62 TranslateErrorsType error_type);
63 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698