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.h" | 5 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 SpellcheckService* spellcheck = GetSpellcheckService(); | 89 SpellcheckService* spellcheck = GetSpellcheckService(); |
90 // Spellcheck service may not be available for a renderer process that is | 90 // Spellcheck service may not be available for a renderer process that is |
91 // shutting down. | 91 // shutting down. |
92 if (!spellcheck) | 92 if (!spellcheck) |
93 return; | 93 return; |
94 if (spellcheck->GetMetrics()) | 94 if (spellcheck->GetMetrics()) |
95 spellcheck->GetMetrics()->RecordCheckedWordStats(word, misspelled); | 95 spellcheck->GetMetrics()->RecordCheckedWordStats(word, misspelled); |
96 } | 96 } |
97 | 97 |
98 void SpellCheckMessageFilter::OnRespondDocumentMarkers( | 98 void SpellCheckMessageFilter::OnRespondDocumentMarkers( |
99 const std::vector<uint32>& markers) { | 99 const std::vector<uint32_t>& markers) { |
100 SpellcheckService* spellcheck = GetSpellcheckService(); | 100 SpellcheckService* spellcheck = GetSpellcheckService(); |
101 // Spellcheck service may not be available for a renderer process that is | 101 // Spellcheck service may not be available for a renderer process that is |
102 // shutting down. | 102 // shutting down. |
103 if (!spellcheck) | 103 if (!spellcheck) |
104 return; | 104 return; |
105 spellcheck->GetFeedbackSender()->OnReceiveDocumentMarkers( | 105 spellcheck->GetFeedbackSender()->OnReceiveDocumentMarkers( |
106 render_process_id_, markers); | 106 render_process_id_, markers); |
107 } | 107 } |
108 | 108 |
109 #if !defined(USE_BROWSER_SPELLCHECKER) | 109 #if !defined(USE_BROWSER_SPELLCHECKER) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 base::Unretained(this), | 181 base::Unretained(this), |
182 route_id, | 182 route_id, |
183 identifier, | 183 identifier, |
184 markers)); | 184 markers)); |
185 } | 185 } |
186 #endif | 186 #endif |
187 | 187 |
188 SpellcheckService* SpellCheckMessageFilter::GetSpellcheckService() const { | 188 SpellcheckService* SpellCheckMessageFilter::GetSpellcheckService() const { |
189 return SpellcheckServiceFactory::GetForRenderProcessId(render_process_id_); | 189 return SpellcheckServiceFactory::GetForRenderProcessId(render_process_id_); |
190 } | 190 } |
OLD | NEW |