| 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 IPC_ENUM_TRAITS(SpellCheckResult::Type) |
| 15 | 16 |
| 16 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebTextCheckingResult) | 17 IPC_STRUCT_TRAITS_BEGIN(SpellCheckResult) |
| 17 IPC_STRUCT_TRAITS_MEMBER(error) | 18 IPC_STRUCT_TRAITS_MEMBER(type) |
| 18 IPC_STRUCT_TRAITS_MEMBER(position) | 19 IPC_STRUCT_TRAITS_MEMBER(location) |
| 19 IPC_STRUCT_TRAITS_MEMBER(length) | 20 IPC_STRUCT_TRAITS_MEMBER(length) |
| 21 IPC_STRUCT_TRAITS_MEMBER(replacement) |
| 20 IPC_STRUCT_TRAITS_END() | 22 IPC_STRUCT_TRAITS_END() |
| 21 | 23 |
| 22 | |
| 23 // Messages sent from the browser to the renderer. | 24 // Messages sent from the browser to the renderer. |
| 24 | 25 |
| 25 IPC_MESSAGE_ROUTED0(SpellCheckMsg_ToggleSpellCheck) | 26 IPC_MESSAGE_ROUTED0(SpellCheckMsg_ToggleSpellCheck) |
| 26 | 27 |
| 27 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, | 28 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, |
| 28 bool) | 29 bool) |
| 29 | 30 |
| 30 #if defined(OS_MACOSX) | 31 #if defined(OS_MACOSX) |
| 31 // Sends when NSSpellChecker finishes checking text received by a preceeding | 32 // Sends when NSSpellChecker finishes checking text received by a preceeding |
| 32 // SpellCheckHostMsg_RequestTextCheck message. | 33 // SpellCheckHostMsg_RequestTextCheck message. |
| 33 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, | 34 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, |
| 34 int /* request identifier given by WebKit */, | 35 int /* request identifier given by WebKit */, |
| 35 int /* document tag */, | 36 int /* document tag */, |
| 36 std::vector<WebKit::WebTextCheckingResult>) | 37 std::vector<SpellCheckResult>) |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 // This message tells the renderer to advance to the next misspelling. It is | 40 // 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. | 41 // sent when the user clicks the "Find Next" button on the spelling panel. |
| 41 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) | 42 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) |
| 42 | 43 |
| 43 // Passes some initialization params to the renderer's spellchecker. This can | 44 // Passes some initialization params to the renderer's spellchecker. This can |
| 44 // be called directly after startup or in (async) response to a | 45 // be called directly after startup or in (async) response to a |
| 45 // RequestDictionary ViewHost message. | 46 // RequestDictionary ViewHost message. |
| 46 IPC_MESSAGE_CONTROL4(SpellCheckMsg_Init, | 47 IPC_MESSAGE_CONTROL4(SpellCheckMsg_Init, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 57 // Toggle the auto spell correct functionality. | 58 // Toggle the auto spell correct functionality. |
| 58 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableAutoSpellCorrect, | 59 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableAutoSpellCorrect, |
| 59 bool /* enable */) | 60 bool /* enable */) |
| 60 | 61 |
| 61 #if !defined(OS_MACOSX) | 62 #if !defined(OS_MACOSX) |
| 62 // Sends text-check results from the Spelling service when the service finishes | 63 // Sends text-check results from the Spelling service when the service finishes |
| 63 // checking text reveived by a SpellCheckHostMsg_CallSpellingService message. | 64 // checking text reveived by a SpellCheckHostMsg_CallSpellingService message. |
| 64 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondSpellingService, | 65 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondSpellingService, |
| 65 int /* request identifier given by WebKit */, | 66 int /* request identifier given by WebKit */, |
| 66 int /* document tag */, | 67 int /* document tag */, |
| 67 std::vector<WebKit::WebTextCheckingResult>) | 68 std::vector<SpellCheckResult>) |
| 68 #endif | 69 #endif |
| 69 | 70 |
| 70 // Messages sent from the renderer to the browser. | 71 // Messages sent from the renderer to the browser. |
| 71 | 72 |
| 72 // The renderer has tried to spell check a word, but couldn't because no | 73 // 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 | 74 // dictionary was available to load. Request that the browser find an |
| 74 // appropriate dictionary and return it. | 75 // appropriate dictionary and return it. |
| 75 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) | 76 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) |
| 76 | 77 |
| 77 // Tracks spell checking occurrence to collect histogram. | 78 // 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, | 122 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_RequestTextCheck, |
| 122 int /* route_id for response */, | 123 int /* route_id for response */, |
| 123 int /* request identifier given by WebKit */, | 124 int /* request identifier given by WebKit */, |
| 124 int /* document tag */, | 125 int /* document tag */, |
| 125 string16 /* sentence */) | 126 string16 /* sentence */) |
| 126 | 127 |
| 127 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, | 128 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, |
| 128 bool /* enabled */, | 129 bool /* enabled */, |
| 129 bool /* checked */) | 130 bool /* checked */) |
| 130 #endif // OS_MACOSX | 131 #endif // OS_MACOSX |
| OLD | NEW |