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 "chrome/common/spellcheck_bdict_language.h" | 10 #include "components/spellcheck/common/spellcheck_bdict_language.h" |
11 #include "chrome/common/spellcheck_marker.h" | 11 #include "components/spellcheck/common/spellcheck_marker.h" |
12 #include "chrome/common/spellcheck_result.h" | 12 #include "components/spellcheck/common/spellcheck_result.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
14 #include "ipc/ipc_platform_file.h" | 14 #include "ipc/ipc_platform_file.h" |
15 | 15 |
16 #if !defined(ENABLE_SPELLCHECK) | 16 #if !defined(ENABLE_SPELLCHECK) |
17 #error "Spellcheck should be enabled" | 17 #error "Spellcheck should be enabled" |
18 #endif | 18 #endif |
19 | 19 |
20 #define IPC_MESSAGE_START SpellCheckMsgStart | 20 #define IPC_MESSAGE_START SpellCheckMsgStart |
21 | 21 |
22 IPC_ENUM_TRAITS(SpellCheckResult::Decoration) | 22 IPC_ENUM_TRAITS(SpellCheckResult::Decoration) |
(...skipping 11 matching lines...) Expand all Loading... |
34 IPC_STRUCT_TRAITS_MEMBER(offset) | 34 IPC_STRUCT_TRAITS_MEMBER(offset) |
35 IPC_STRUCT_TRAITS_END() | 35 IPC_STRUCT_TRAITS_END() |
36 | 36 |
37 IPC_STRUCT_TRAITS_BEGIN(SpellCheckBDictLanguage) | 37 IPC_STRUCT_TRAITS_BEGIN(SpellCheckBDictLanguage) |
38 IPC_STRUCT_TRAITS_MEMBER(file) | 38 IPC_STRUCT_TRAITS_MEMBER(file) |
39 IPC_STRUCT_TRAITS_MEMBER(language) | 39 IPC_STRUCT_TRAITS_MEMBER(language) |
40 IPC_STRUCT_TRAITS_END() | 40 IPC_STRUCT_TRAITS_END() |
41 | 41 |
42 // Messages sent from the browser to the renderer. | 42 // Messages sent from the browser to the renderer. |
43 | 43 |
44 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableSpellCheck, | 44 IPC_MESSAGE_CONTROL1(SpellCheckMsg_EnableSpellCheck, bool) |
45 bool) | |
46 | 45 |
47 // Passes some initialization params from the browser to the renderer's | 46 // Passes some initialization params from the browser to the renderer's |
48 // spellchecker. This can be called directly after startup or in (async) | 47 // spellchecker. This can be called directly after startup or in (async) |
49 // response to a RequestDictionary ViewHost message. | 48 // response to a RequestDictionary ViewHost message. |
50 IPC_MESSAGE_CONTROL2(SpellCheckMsg_Init, | 49 IPC_MESSAGE_CONTROL2(SpellCheckMsg_Init, |
51 std::vector<SpellCheckBDictLanguage> /* bdict_languages */, | 50 std::vector<SpellCheckBDictLanguage> /* bdict_languages */, |
52 std::set<std::string> /* custom_dict_words */) | 51 std::set<std::string> /* custom_dict_words */) |
53 | 52 |
54 // Words have been added and removed in the custom dictionary; update the local | 53 // Words have been added and removed in the custom dictionary; update the local |
55 // custom word list. | 54 // custom word list. |
56 IPC_MESSAGE_CONTROL2(SpellCheckMsg_CustomDictionaryChanged, | 55 IPC_MESSAGE_CONTROL2(SpellCheckMsg_CustomDictionaryChanged, |
57 std::set<std::string> /* words_added */, | 56 std::set<std::string> /* words_added */, |
58 std::set<std::string> /* words_removed */) | 57 std::set<std::string> /* words_removed */) |
59 | 58 |
60 // Request a list of all document markers in the renderer for spelling service | 59 // Request a list of all document markers in the renderer for spelling service |
61 // feedback. | 60 // feedback. |
62 IPC_MESSAGE_CONTROL0(SpellCheckMsg_RequestDocumentMarkers) | 61 IPC_MESSAGE_CONTROL0(SpellCheckMsg_RequestDocumentMarkers) |
63 | 62 |
64 // Send a list of document markers in the renderer to the spelling service | 63 // Send a list of document markers in the renderer to the spelling service |
65 // feedback sender. | 64 // feedback sender. |
66 IPC_MESSAGE_CONTROL1(SpellCheckHostMsg_RespondDocumentMarkers, | 65 IPC_MESSAGE_CONTROL1(SpellCheckHostMsg_RespondDocumentMarkers, |
67 std::vector<uint32_t> /* document marker identifiers */) | 66 std::vector<uint32_t> /* document marker identifiers */) |
68 | 67 |
69 #if !defined(USE_BROWSER_SPELLCHECKER) | 68 #if !defined(USE_BROWSER_SPELLCHECKER) |
70 // Sends text-check results from the Spelling service when the service finishes | 69 // Sends text-check results from the Spelling service when the service finishes |
71 // checking text received by a SpellCheckHostMsg_CallSpellingService message. | 70 // checking text received by a SpellCheckHostMsg_CallSpellingService message. |
72 // If the service is not available, the 4th parameter should be false and the | 71 // If the service is not available, the 4th parameter should be false and the |
73 // 5th parameter should contain the requested sentence. | 72 // 5th parameter should contain the requested sentence. |
74 IPC_MESSAGE_ROUTED4(SpellCheckMsg_RespondSpellingService, | 73 IPC_MESSAGE_ROUTED4(SpellCheckMsg_RespondSpellingService, |
75 int /* request identifier given by WebKit */, | 74 int /* request identifier given by WebKit */, |
76 bool /* succeeded calling service */, | 75 bool /* succeeded calling service */, |
77 base::string16 /* sentence */, | 76 base::string16 /* sentence */, |
78 std::vector<SpellCheckResult>) | 77 std::vector<SpellCheckResult>) |
79 #endif | 78 #endif |
80 | 79 |
81 #if defined(USE_BROWSER_SPELLCHECKER) | 80 #if defined(USE_BROWSER_SPELLCHECKER) |
82 // This message tells the renderer to advance to the next misspelling. It is | 81 // This message tells the renderer to advance to the next misspelling. It is |
83 // sent when the user clicks the "Find Next" button on the spelling panel. | 82 // sent when the user clicks the "Find Next" button on the spelling panel. |
84 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) | 83 IPC_MESSAGE_ROUTED0(SpellCheckMsg_AdvanceToNextMisspelling) |
85 | 84 |
86 // Sends when NSSpellChecker finishes checking text received by a preceding | 85 // Sends when NSSpellChecker finishes checking text received by a preceding |
87 // SpellCheckHostMsg_RequestTextCheck message. | 86 // SpellCheckHostMsg_RequestTextCheck message. |
88 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, | 87 IPC_MESSAGE_ROUTED3(SpellCheckMsg_RespondTextCheck, |
89 int /* request identifier given by WebKit */, | 88 int /* request identifier given by WebKit */, |
90 base::string16 /* sentence */, | 89 base::string16 /* sentence */, |
91 std::vector<SpellCheckResult>) | 90 std::vector<SpellCheckResult>) |
92 | 91 |
93 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, | 92 IPC_MESSAGE_ROUTED1(SpellCheckMsg_ToggleSpellPanel, bool) |
94 bool) | |
95 #endif | 93 #endif |
96 | 94 |
97 // Messages sent from the renderer to the browser. | 95 // Messages sent from the renderer to the browser. |
98 | 96 |
99 // The renderer has tried to spell check a word, but couldn't because no | 97 // The renderer has tried to spell check a word, but couldn't because no |
100 // dictionary was available to load. Request that the browser find an | 98 // dictionary was available to load. Request that the browser find an |
101 // appropriate dictionary and return it. | 99 // appropriate dictionary and return it. |
102 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) | 100 IPC_MESSAGE_CONTROL0(SpellCheckHostMsg_RequestDictionary) |
103 | 101 |
104 // Tracks spell checking occurrence to collect histogram. | 102 // Tracks spell checking occurrence to collect histogram. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_RequestTextCheck, | 137 IPC_MESSAGE_CONTROL4(SpellCheckHostMsg_RequestTextCheck, |
140 int /* route_id for response */, | 138 int /* route_id for response */, |
141 int /* request identifier given by WebKit */, | 139 int /* request identifier given by WebKit */, |
142 base::string16 /* sentence */, | 140 base::string16 /* sentence */, |
143 std::vector<SpellCheckMarker> /* markers */) | 141 std::vector<SpellCheckMarker> /* markers */) |
144 | 142 |
145 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, | 143 IPC_MESSAGE_ROUTED2(SpellCheckHostMsg_ToggleSpellCheck, |
146 bool /* enabled */, | 144 bool /* enabled */, |
147 bool /* checked */) | 145 bool /* checked */) |
148 #endif // USE_BROWSER_SPELLCHECKER | 146 #endif // USE_BROWSER_SPELLCHECKER |
OLD | NEW |