OLD | NEW |
| (Empty) |
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. | |
4 | |
5 // Multiply-included message file, hence no include guard. | |
6 | |
7 #include "components/translate/core/common/language_detection_details.h" | |
8 #include "components/translate/core/common/translate_errors.h" | |
9 #include "ipc/ipc_message_macros.h" | |
10 #include "ipc/ipc_message_utils.h" | |
11 #include "url/ipc/url_param_traits.h" | |
12 | |
13 #define IPC_MESSAGE_START TranslateMsgStart | |
14 | |
15 IPC_ENUM_TRAITS_MAX_VALUE(translate::TranslateErrors::Type, | |
16 translate::TranslateErrors::TYPE_LAST) | |
17 | |
18 IPC_STRUCT_TRAITS_BEGIN(translate::LanguageDetectionDetails) | |
19 IPC_STRUCT_TRAITS_MEMBER(time) | |
20 IPC_STRUCT_TRAITS_MEMBER(url) | |
21 IPC_STRUCT_TRAITS_MEMBER(content_language) | |
22 IPC_STRUCT_TRAITS_MEMBER(cld_language) | |
23 IPC_STRUCT_TRAITS_MEMBER(is_cld_reliable) | |
24 IPC_STRUCT_TRAITS_MEMBER(has_notranslate) | |
25 IPC_STRUCT_TRAITS_MEMBER(html_root_language) | |
26 IPC_STRUCT_TRAITS_MEMBER(adopted_language) | |
27 IPC_STRUCT_TRAITS_MEMBER(contents) | |
28 IPC_STRUCT_TRAITS_END() | |
29 | |
30 //----------------------------------------------------------------------------- | |
31 // RenderFrame messages | |
32 // These are messages sent from the browser to the renderer process. | |
33 | |
34 // Tells the renderer to translate the page contents from one language to | |
35 // another. | |
36 IPC_MESSAGE_ROUTED4(ChromeFrameMsg_TranslatePage, | |
37 int /* page_seq_no */, | |
38 std::string, /* the script injected in the page */ | |
39 std::string, /* BCP 47/RFC 5646 language code the page | |
40 is in */ | |
41 std::string /* BCP 47/RFC 5646 language code to translate | |
42 to */) | |
43 | |
44 // Tells the renderer to revert the text of translated page to its original | |
45 // contents. | |
46 IPC_MESSAGE_ROUTED1(ChromeFrameMsg_RevertTranslation, int /* page id */) | |
47 | |
48 //----------------------------------------------------------------------------- | |
49 // Host messages | |
50 // These are messages sent from the renderer to the browser process. | |
51 | |
52 // Notification that the current page was assigned a sequence number. | |
53 IPC_MESSAGE_ROUTED1(ChromeFrameHostMsg_TranslateAssignedSequenceNumber, | |
54 int /* page_seq_no */) | |
55 | |
56 // Notification that the language for the tab has been determined. | |
57 IPC_MESSAGE_ROUTED2( | |
58 ChromeFrameHostMsg_TranslateLanguageDetermined, | |
59 translate::LanguageDetectionDetails /* details about lang detection */, | |
60 bool /* whether the page needs translation */) | |
61 | |
62 // Notifies the browser that a page has been translated. | |
63 IPC_MESSAGE_ROUTED3( | |
64 ChromeFrameHostMsg_PageTranslated, | |
65 std::string /* the original language */, | |
66 std::string /* the translated language */, | |
67 translate::TranslateErrors::Type /* the error type if available */) | |
OLD | NEW |