| 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 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 5 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 render_process_id_(render_process_id), | 193 render_process_id_(render_process_id), |
| 194 client_(new SpellingServiceClient) { | 194 client_(new SpellingServiceClient) { |
| 195 } | 195 } |
| 196 | 196 |
| 197 void SpellCheckMessageFilterMac::OverrideThreadForMessage( | 197 void SpellCheckMessageFilterMac::OverrideThreadForMessage( |
| 198 const IPC::Message& message, BrowserThread::ID* thread) { | 198 const IPC::Message& message, BrowserThread::ID* thread) { |
| 199 if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID) | 199 if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID) |
| 200 *thread = BrowserThread::UI; | 200 *thread = BrowserThread::UI; |
| 201 } | 201 } |
| 202 | 202 |
| 203 bool SpellCheckMessageFilterMac::OnMessageReceived(const IPC::Message& message, | 203 bool SpellCheckMessageFilterMac::OnMessageReceived( |
| 204 bool* message_was_ok) { | 204 const IPC::Message& message) { |
| 205 bool handled = true; | 205 bool handled = true; |
| 206 IPC_BEGIN_MESSAGE_MAP_EX(SpellCheckMessageFilterMac, message, *message_was_ok) | 206 IPC_BEGIN_MESSAGE_MAP(SpellCheckMessageFilterMac, message) |
| 207 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CheckSpelling, | 207 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CheckSpelling, |
| 208 OnCheckSpelling) | 208 OnCheckSpelling) |
| 209 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_FillSuggestionList, | 209 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_FillSuggestionList, |
| 210 OnFillSuggestionList) | 210 OnFillSuggestionList) |
| 211 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ShowSpellingPanel, | 211 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ShowSpellingPanel, |
| 212 OnShowSpellingPanel) | 212 OnShowSpellingPanel) |
| 213 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, | 213 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, |
| 214 OnUpdateSpellingPanelWithMisspelledWord) | 214 OnUpdateSpellingPanelWithMisspelledWord) |
| 215 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_RequestTextCheck, | 215 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_RequestTextCheck, |
| 216 OnRequestTextCheck) | 216 OnRequestTextCheck) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 // TODO(groby): We are currently not notified of retired tags. We need | 299 // TODO(groby): We are currently not notified of retired tags. We need |
| 300 // to track destruction of RenderViewHosts on the browser process side | 300 // to track destruction of RenderViewHosts on the browser process side |
| 301 // to update our mappings when a document goes away. | 301 // to update our mappings when a document goes away. |
| 302 void SpellCheckMessageFilterMac::RetireDocumentTag(int route_id) { | 302 void SpellCheckMessageFilterMac::RetireDocumentTag(int route_id) { |
| 303 spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); | 303 spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); |
| 304 tag_map_.erase(route_id); | 304 tag_map_.erase(route_id); |
| 305 } | 305 } |
| 306 | 306 |
| OLD | NEW |