Chromium Code Reviews| 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 "content/public/common/common_param_traits.h" | |
| 10 #include "ipc/ipc_message_macros.h" | |
| 11 #include "ipc/ipc_message_utils.h" | |
| 12 | |
| 13 #define IPC_MESSAGE_START TranslateMsgStart | |
| 14 | |
| 15 IPC_ENUM_TRAITS(TranslateErrors::Type) | |
| 16 | |
| 17 IPC_STRUCT_TRAITS_BEGIN(LanguageDetectionDetails) | |
| 18 IPC_STRUCT_TRAITS_MEMBER(time) | |
| 19 IPC_STRUCT_TRAITS_MEMBER(url) | |
| 20 IPC_STRUCT_TRAITS_MEMBER(content_language) | |
| 21 IPC_STRUCT_TRAITS_MEMBER(cld_language) | |
| 22 IPC_STRUCT_TRAITS_MEMBER(is_cld_reliable) | |
| 23 IPC_STRUCT_TRAITS_MEMBER(html_root_language) | |
| 24 IPC_STRUCT_TRAITS_MEMBER(adopted_language) | |
| 25 IPC_STRUCT_TRAITS_MEMBER(contents) | |
| 26 IPC_STRUCT_TRAITS_END() | |
| 27 | |
| 28 //----------------------------------------------------------------------------- | |
| 29 // RenderView messages | |
| 30 // These are messages sent from the browser to the renderer process. | |
| 31 | |
| 32 // Tells the renderer to translate the page contents from one language to | |
| 33 // another. | |
| 34 IPC_MESSAGE_ROUTED4(ChromeViewMsg_TranslatePage, | |
| 35 int /* page id */, | |
| 36 std::string, /* the script injected in the page */ | |
| 37 std::string, /* BCP 47/RFC 5646 language code the page | |
|
palmer
2014/04/01 22:36:13
Does the recipient of these messages validate the
droger
2014/04/02 08:16:10
I know languages are validated at some point (such
| |
| 38 is in */ | |
| 39 std::string /* BCP 47/RFC 5646 language code to translate | |
| 40 to */) | |
| 41 | |
| 42 #if defined(CLD2_DYNAMIC_MODE) | |
| 43 // Informs the renderer process that Compact Language Detector (CLD) data is | |
| 44 // available and provides an IPC::PlatformFileForTransit obtained from | |
| 45 // IPC::GetFileHandleForProcess(...) | |
| 46 // See also: ChromeViewHostMsg_NeedCLDData | |
| 47 IPC_MESSAGE_ROUTED3(ChromeViewMsg_CLDDataAvailable, | |
| 48 IPC::PlatformFileForTransit /* ipc_file_handle */, | |
| 49 uint64 /* data_offset */, | |
| 50 uint64 /* data_length */) | |
| 51 #endif | |
| 52 | |
| 53 //----------------------------------------------------------------------------- | |
| 54 // Misc messages | |
| 55 // These are messages sent from the renderer to the browser process. | |
| 56 | |
| 57 // Notification that the language for the tab has been determined. | |
| 58 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_TranslateLanguageDetermined, | |
| 59 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_ROUTED4(ChromeViewHostMsg_PageTranslated, | |
| 64 int, /* page id */ | |
| 65 std::string /* the original language */, | |
|
palmer
2014/04/01 22:36:13
Same here as above, presumably.
| |
| 66 std::string /* the translated language */, | |
| 67 TranslateErrors::Type /* the error type if available */) | |
| 68 | |
| 69 // Tells the renderer to revert the text of translated page to its original | |
| 70 // contents. | |
| 71 IPC_MESSAGE_ROUTED1(ChromeViewMsg_RevertTranslation, | |
| 72 int /* page id */) | |
| 73 | |
| 74 #if defined(CLD2_DYNAMIC_MODE) | |
| 75 // Informs the browser process that Compact Language Detector (CLD) data is | |
| 76 // required by the originating renderer. The browser process should respond | |
| 77 // with a ChromeViewMsg_CLDDataAvailable if the data is available, else it | |
| 78 // should go unanswered (the renderer will ask again later). | |
| 79 // See also: ChromeViewMsg_CLDDataAvailable | |
| 80 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_NeedCLDData) | |
| 81 #endif | |
| OLD | NEW |