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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 void SpellingRequest::OnLocalCheckCompleted( | 181 void SpellingRequest::OnLocalCheckCompleted( |
182 const std::vector<SpellCheckResult>& results) { | 182 const std::vector<SpellCheckResult>& results) { |
183 // Local checking can happen on any thread - don't DCHECK thread. | 183 // Local checking can happen on any thread - don't DCHECK thread. |
184 local_results_ = results; | 184 local_results_ = results; |
185 completion_barrier_.Run(); | 185 completion_barrier_.Run(); |
186 } | 186 } |
187 | 187 |
188 | 188 |
189 SpellCheckMessageFilterMac::SpellCheckMessageFilterMac(int render_process_id) | 189 SpellCheckMessageFilterMac::SpellCheckMessageFilterMac(int render_process_id) |
190 : BrowserMessageFilter(SpellCheckMsgStart), | 190 : render_process_id_(render_process_id), |
191 render_process_id_(render_process_id), | |
192 client_(new SpellingServiceClient) { | 191 client_(new SpellingServiceClient) { |
193 } | 192 } |
194 | 193 |
195 void SpellCheckMessageFilterMac::OverrideThreadForMessage( | 194 void SpellCheckMessageFilterMac::OverrideThreadForMessage( |
196 const IPC::Message& message, BrowserThread::ID* thread) { | 195 const IPC::Message& message, BrowserThread::ID* thread) { |
197 if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID) | 196 if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID) |
198 *thread = BrowserThread::UI; | 197 *thread = BrowserThread::UI; |
199 } | 198 } |
200 | 199 |
201 bool SpellCheckMessageFilterMac::OnMessageReceived(const IPC::Message& message, | 200 bool SpellCheckMessageFilterMac::OnMessageReceived(const IPC::Message& message, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 294 } |
296 | 295 |
297 // TODO(groby): We are currently not notified of retired tags. We need | 296 // TODO(groby): We are currently not notified of retired tags. We need |
298 // to track destruction of RenderViewHosts on the browser process side | 297 // to track destruction of RenderViewHosts on the browser process side |
299 // to update our mappings when a document goes away. | 298 // to update our mappings when a document goes away. |
300 void SpellCheckMessageFilterMac::RetireDocumentTag(int route_id) { | 299 void SpellCheckMessageFilterMac::RetireDocumentTag(int route_id) { |
301 spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); | 300 spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); |
302 tag_map_.erase(route_id); | 301 tag_map_.erase(route_id); |
303 } | 302 } |
304 | 303 |
OLD | NEW |