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_marker.h" |
8 #include "chrome/common/spellcheck_result.h" | 9 #include "chrome/common/spellcheck_result.h" |
9 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
10 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
11 | 12 |
12 | 13 |
13 #define IPC_MESSAGE_START SpellCheckMsgStart | 14 #define IPC_MESSAGE_START SpellCheckMsgStart |
14 | 15 |
15 IPC_ENUM_TRAITS(SpellCheckResult::Type) | 16 IPC_ENUM_TRAITS(SpellCheckResult::Type) |
16 | 17 |
17 IPC_STRUCT_TRAITS_BEGIN(SpellCheckResult) | 18 IPC_STRUCT_TRAITS_BEGIN(SpellCheckResult) |
18 IPC_STRUCT_TRAITS_MEMBER(type) | 19 IPC_STRUCT_TRAITS_MEMBER(type) |
19 IPC_STRUCT_TRAITS_MEMBER(location) | 20 IPC_STRUCT_TRAITS_MEMBER(location) |
20 IPC_STRUCT_TRAITS_MEMBER(length) | 21 IPC_STRUCT_TRAITS_MEMBER(length) |
21 IPC_STRUCT_TRAITS_MEMBER(replacement) | 22 IPC_STRUCT_TRAITS_MEMBER(replacement) |
| 23 IPC_STRUCT_TRAITS_MEMBER(hash) |
| 24 IPC_STRUCT_TRAITS_END() |
| 25 |
| 26 IPC_STRUCT_TRAITS_BEGIN(SpellCheckMarker) |
| 27 IPC_STRUCT_TRAITS_MEMBER(hash) |
| 28 IPC_STRUCT_TRAITS_MEMBER(offset) |
22 IPC_STRUCT_TRAITS_END() | 29 IPC_STRUCT_TRAITS_END() |
23 | 30 |
24 // Messages sent from the browser to the renderer. | 31 // Messages sent from the browser to the renderer. |
25 | 32 |
26 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableSpellCheck, | 33 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableSpellCheck, |
27 bool) | 34 bool) |
28 | 35 |
29 // Passes some initialization params to the renderer's spellchecker. This can | 36 // Passes some initialization params to the renderer's spellchecker. This can |
30 // be called directly after startup or in (async) response to a | 37 // be called directly after startup or in (async) response to a |
31 // RequestDictionary ViewHost message. | 38 // RequestDictionary ViewHost message. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 97 |
91 // Tracks spell checking occurrence to collect histogram. | 98 // Tracks spell checking occurrence to collect histogram. |
92 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_NotifyChecked, | 99 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_NotifyChecked, |
93 string16 /* word */, | 100 string16 /* word */, |
94 bool /* true if checked word is misspelled */) | 101 bool /* true if checked word is misspelled */) |
95 | 102 |
96 #if !defined(OS_MACOSX) | 103 #if !defined(OS_MACOSX) |
97 // Asks the Spelling service to check text. When the service finishes checking | 104 // Asks the Spelling service to check text. When the service finishes checking |
98 // the input text, it sends a SpellingCheckMsg_RespondSpellingService with | 105 // the input text, it sends a SpellingCheckMsg_RespondSpellingService with |
99 // text-check results. | 106 // text-check results. |
100 IPC_MESSAGE_CONTROL3(SpellCheckHostMsg_CallSpellingService, | 107 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_CallSpellingService, |
101 int /* route_id for response */, | 108 int /* route_id for response */, |
102 int /* request identifier given by WebKit */, | 109 int /* request identifier given by WebKit */, |
103 string16 /* sentence */) | 110 string16 /* sentence */, |
| 111 std::vector<SpellCheckMarker> /* markers */) |
104 #endif | 112 #endif |
105 | 113 |
106 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
107 // Tells the browser to display or not display the SpellingPanel | 115 // Tells the browser to display or not display the SpellingPanel |
108 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_ShowSpellingPanel, | 116 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_ShowSpellingPanel, |
109 bool /* if true, then show it, otherwise hide it*/) | 117 bool /* if true, then show it, otherwise hide it*/) |
110 | 118 |
111 // Tells the browser to update the spelling panel with the given word. | 119 // Tells the browser to update the spelling panel with the given word. |
112 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, | 120 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, |
113 string16 /* the word to update the panel with */) | 121 string16 /* the word to update the panel with */) |
(...skipping 10 matching lines...) Expand all Loading... |
124 | 132 |
125 IPC_MESSAGE_CONTROL3(SpellCheckHostMsg_RequestTextCheck, | 133 IPC_MESSAGE_CONTROL3(SpellCheckHostMsg_RequestTextCheck, |
126 int /* route_id for response */, | 134 int /* route_id for response */, |
127 int /* request identifier given by WebKit */, | 135 int /* request identifier given by WebKit */, |
128 string16 /* sentence */) | 136 string16 /* sentence */) |
129 | 137 |
130 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, | 138 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, |
131 bool /* enabled */, | 139 bool /* enabled */, |
132 bool /* checked */) | 140 bool /* checked */) |
133 #endif // OS_MACOSX | 141 #endif // OS_MACOSX |
OLD | NEW |