| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "components/spellcheck/common/spellcheck_result.h" | 10 #include "components/spellcheck/common/spellcheck_result.h" |
| 11 #include "components/spellcheck/spellcheck_build_features.h" | 11 #include "components/spellcheck/spellcheck_build_features.h" |
| 12 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
| 13 | 13 |
| 14 #if !BUILDFLAG(ENABLE_SPELLCHECK) | 14 #if !BUILDFLAG(ENABLE_SPELLCHECK) |
| 15 #error "Spellcheck should be enabled" | 15 #error "Spellcheck should be enabled." |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #define IPC_MESSAGE_START SpellCheckMsgStart | 18 #define IPC_MESSAGE_START SpellCheckMsgStart |
| 19 | 19 |
| 20 IPC_ENUM_TRAITS(SpellCheckResult::Decoration) | 20 IPC_ENUM_TRAITS(SpellCheckResult::Decoration) |
| 21 | 21 |
| 22 IPC_STRUCT_TRAITS_BEGIN(SpellCheckResult) | 22 IPC_STRUCT_TRAITS_BEGIN(SpellCheckResult) |
| 23 IPC_STRUCT_TRAITS_MEMBER(decoration) | 23 IPC_STRUCT_TRAITS_MEMBER(decoration) |
| 24 IPC_STRUCT_TRAITS_MEMBER(location) | 24 IPC_STRUCT_TRAITS_MEMBER(location) |
| 25 IPC_STRUCT_TRAITS_MEMBER(length) | 25 IPC_STRUCT_TRAITS_MEMBER(length) |
| 26 IPC_STRUCT_TRAITS_MEMBER(replacement) | 26 IPC_STRUCT_TRAITS_MEMBER(replacement) |
| 27 IPC_STRUCT_TRAITS_END() | 27 IPC_STRUCT_TRAITS_END() |
| 28 | 28 |
| 29 // Messages sent from the browser to the renderer. | 29 // Messages sent from the browser to the renderer. |
| 30 | 30 |
| 31 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER) | |
| 32 // Sends text-check results from the Spelling service when the service finishes | |
| 33 // checking text received by a SpellCheckHostMsg_CallSpellingService message. | |
| 34 // If the service is not available, the 4th parameter should be false and the | |
| 35 // 5th parameter should contain the requested sentence. | |
| 36 IPC_MESSAGE_ROUTED4(SpellCheckMsg_RespondSpellingService, | |
| 37 int /* request identifier given by WebKit */, | |
| 38 bool /* succeeded calling service */, | |
| 39 base::string16 /* sentence */, | |
| 40 std::vector<SpellCheckResult>) | |
| 41 #endif | |
| 42 | |
| 43 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) | 31 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) |
| 44 // Sends when NSSpellChecker finishes checking text received by a preceding | 32 // Sends when NSSpellChecker finishes checking text received by a preceding |
| 45 // SpellCheckHostMsg_RequestTextCheck message. | 33 // SpellCheckHostMsg_RequestTextCheck message. |
| 46 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, | 34 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, |
| 47 int /* request identifier given by WebKit */, | 35 int /* request identifier given by WebKit */, |
| 48 base::string16 /* sentence */, | 36 base::string16 /* sentence */, |
| 49 std::vector<SpellCheckResult>) | 37 std::vector<SpellCheckResult>) |
| 50 #endif | 38 #endif |
| 51 | 39 |
| 52 #if BUILDFLAG(HAS_SPELLCHECK_PANEL) | 40 #if BUILDFLAG(HAS_SPELLCHECK_PANEL) |
| 53 // This message tells the renderer to advance to the next misspelling. It is | 41 // This message tells the renderer to advance to the next misspelling. It is |
| 54 // sent when the user clicks the "Find Next" button on the spelling panel. | 42 // sent when the user clicks the "Find Next" button on the spelling panel. |
| 55 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) | 43 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) |
| 56 | 44 |
| 57 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, bool) | 45 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, bool) |
| 58 #endif | 46 #endif |
| 59 | 47 |
| 60 // Messages sent from the renderer to the browser. | 48 // Messages sent from the renderer to the browser. |
| 61 | 49 |
| 62 // The renderer has tried to spell check a word, but couldn't because no | |
| 63 // dictionary was available to load. Request that the browser find an | |
| 64 // appropriate dictionary and return it. | |
| 65 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) | |
| 66 | |
| 67 // Tracks spell checking occurrence to collect histogram. | |
| 68 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_NotifyChecked, | |
| 69 base::string16 /* word */, | |
| 70 bool /* true if checked word is misspelled */) | |
| 71 | |
| 72 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER) | |
| 73 // Asks the Spelling service to check text. When the service finishes checking | |
| 74 // the input text, it sends a SpellingCheckMsg_RespondSpellingService with | |
| 75 // text-check results. | |
| 76 IPC_MESSAGE_CONTROL3(SpellCheckHostMsg_CallSpellingService, | |
| 77 int /* route_id for response */, | |
| 78 int /* request identifier given by WebKit */, | |
| 79 base::string16 /* sentence */) | |
| 80 #endif | |
| 81 | |
| 82 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) | 50 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) |
| 83 // TODO(groby): This needs to originate from SpellcheckProvider. | 51 // TODO(groby): This needs to originate from SpellcheckProvider. |
| 84 IPC_SYNC_MESSAGE_CONTROL2_1(SpellCheckHostMsg_CheckSpelling, | 52 IPC_SYNC_MESSAGE_CONTROL2_1(SpellCheckHostMsg_CheckSpelling, |
| 85 base::string16 /* word */, | 53 base::string16 /* word */, |
| 86 int /* route_id */, | 54 int /* route_id */, |
| 87 bool /* correct */) | 55 bool /* correct */) |
| 88 | 56 |
| 89 IPC_SYNC_MESSAGE_CONTROL1_1(SpellCheckHostMsg_FillSuggestionList, | 57 IPC_SYNC_MESSAGE_CONTROL1_1(SpellCheckHostMsg_FillSuggestionList, |
| 90 base::string16 /* word */, | 58 base::string16 /* word */, |
| 91 std::vector<base::string16> /* suggestions */) | 59 std::vector<base::string16> /* suggestions */) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 102 | 70 |
| 103 #if BUILDFLAG(HAS_SPELLCHECK_PANEL) | 71 #if BUILDFLAG(HAS_SPELLCHECK_PANEL) |
| 104 // Tells the browser to display or not display the SpellingPanel | 72 // Tells the browser to display or not display the SpellingPanel |
| 105 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_ShowSpellingPanel, | 73 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_ShowSpellingPanel, |
| 106 bool /* if true, then show it, otherwise hide it*/) | 74 bool /* if true, then show it, otherwise hide it*/) |
| 107 | 75 |
| 108 // Tells the browser to update the spelling panel with the given word. | 76 // Tells the browser to update the spelling panel with the given word. |
| 109 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, | 77 IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, |
| 110 base::string16 /* the word to update the panel with */) | 78 base::string16 /* the word to update the panel with */) |
| 111 #endif | 79 #endif |
| OLD | NEW |