| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // IPC messages for spellcheck. | 5 // IPC messages for spellcheck. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include "chrome/common/spellcheck_result.h" |
| 8 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
| 9 #include "ipc/ipc_platform_file.h" | 10 #include "ipc/ipc_platform_file.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCheckingResult
.h" | 11 |
| 11 | 12 |
| 12 #define IPC_MESSAGE_START SpellCheckMsgStart | 13 #define IPC_MESSAGE_START SpellCheckMsgStart |
| 13 | 14 |
| 14 IPC_ENUM_TRAITS(WebKit::WebTextCheckingResult::Error) | |
| 15 | |
| 16 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebTextCheckingResult) | |
| 17 IPC_STRUCT_TRAITS_MEMBER(error) | |
| 18 IPC_STRUCT_TRAITS_MEMBER(position) | |
| 19 IPC_STRUCT_TRAITS_MEMBER(length) | |
| 20 IPC_STRUCT_TRAITS_END() | |
| 21 | |
| 22 | |
| 23 // Messages sent from the browser to the renderer. | 15 // Messages sent from the browser to the renderer. |
| 24 | 16 |
| 25 IPC_MESSAGE_ROUTED0(SpellCheckMsg_ToggleSpellCheck) | 17 IPC_MESSAGE_ROUTED0(SpellCheckMsg_ToggleSpellCheck) |
| 26 | 18 |
| 27 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, | 19 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, |
| 28 bool) | 20 bool) |
| 29 | 21 |
| 30 #if defined(OS_MACOSX) | 22 #if defined(OS_MACOSX) |
| 31 // Sends when NSSpellChecker finishes checking text received by a preceeding | 23 // Sends when NSSpellChecker finishes checking text received by a preceeding |
| 32 // SpellCheckHostMsg_RequestTextCheck message. | 24 // SpellCheckHostMsg_RequestTextCheck message. |
| 33 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, | 25 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, |
| 34 int /* request identifier given by WebKit */, | 26 int /* request identifier given by WebKit */, |
| 35 int /* document tag */, | 27 int /* document tag */, |
| 36 std::vector<WebKit::WebTextCheckingResult>) | 28 std::vector<SpellCheckResult>) |
| 37 #endif | 29 #endif |
| 38 | 30 |
| 39 // This message tells the renderer to advance to the next misspelling. It is | 31 // This message tells the renderer to advance to the next misspelling. It is |
| 40 // sent when the user clicks the "Find Next" button on the spelling panel. | 32 // sent when the user clicks the "Find Next" button on the spelling panel. |
| 41 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) | 33 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) |
| 42 | 34 |
| 43 // Passes some initialization params to the renderer's spellchecker. This can | 35 // Passes some initialization params to the renderer's spellchecker. This can |
| 44 // be called directly after startup or in (async) response to a | 36 // be called directly after startup or in (async) response to a |
| 45 // RequestDictionary ViewHost message. | 37 // RequestDictionary ViewHost message. |
| 46 IPC_MESSAGE_CONTROL4(SpellCheckMsg_Init, | 38 IPC_MESSAGE_CONTROL4(SpellCheckMsg_Init, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 57 // Toggle the auto spell correct functionality. | 49 // Toggle the auto spell correct functionality. |
| 58 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableAutoSpellCorrect, | 50 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableAutoSpellCorrect, |
| 59 bool /* enable */) | 51 bool /* enable */) |
| 60 | 52 |
| 61 #if !defined(OS_MACOSX) | 53 #if !defined(OS_MACOSX) |
| 62 // Sends text-check results from the Spelling service when the service finishes | 54 // Sends text-check results from the Spelling service when the service finishes |
| 63 // checking text reveived by a SpellCheckHostMsg_CallSpellingService message. | 55 // checking text reveived by a SpellCheckHostMsg_CallSpellingService message. |
| 64 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondSpellingService, | 56 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondSpellingService, |
| 65 int /* request identifier given by WebKit */, | 57 int /* request identifier given by WebKit */, |
| 66 int /* document tag */, | 58 int /* document tag */, |
| 67 std::vector<WebKit::WebTextCheckingResult>) | 59 std::vector<SpellCheckResult>) |
| 68 #endif | 60 #endif |
| 69 | 61 |
| 70 // Messages sent from the renderer to the browser. | 62 // Messages sent from the renderer to the browser. |
| 71 | 63 |
| 72 // The renderer has tried to spell check a word, but couldn't because no | 64 // The renderer has tried to spell check a word, but couldn't because no |
| 73 // dictionary was available to load. Request that the browser find an | 65 // dictionary was available to load. Request that the browser find an |
| 74 // appropriate dictionary and return it. | 66 // appropriate dictionary and return it. |
| 75 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) | 67 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) |
| 76 | 68 |
| 77 // Tracks spell checking occurrence to collect histogram. | 69 // Tracks spell checking occurrence to collect histogram. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_RequestTextCheck, | 113 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_RequestTextCheck, |
| 122 int /* route_id for response */, | 114 int /* route_id for response */, |
| 123 int /* request identifier given by WebKit */, | 115 int /* request identifier given by WebKit */, |
| 124 int /* document tag */, | 116 int /* document tag */, |
| 125 string16 /* sentence */) | 117 string16 /* sentence */) |
| 126 | 118 |
| 127 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, | 119 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, |
| 128 bool /* enabled */, | 120 bool /* enabled */, |
| 129 bool /* checked */) | 121 bool /* checked */) |
| 130 #endif // OS_MACOSX | 122 #endif // OS_MACOSX |
| OLD | NEW |