Chromium Code Reviews| 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 "components/spellcheck/renderer/spellcheck_provider.h" | 5 #include "components/spellcheck/renderer/spellcheck_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "components/spellcheck/common/spellcheck_marker.h" | 9 #include "components/spellcheck/common/spellcheck_marker.h" |
| 10 #include "components/spellcheck/common/spellcheck_messages.h" | 10 #include "components/spellcheck/common/spellcheck_messages.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 return; | 253 return; |
| 254 text_check_completions_.Remove(identifier); | 254 text_check_completions_.Remove(identifier); |
| 255 blink::WebVector<blink::WebTextCheckingResult> textcheck_results; | 255 blink::WebVector<blink::WebTextCheckingResult> textcheck_results; |
| 256 spellcheck_->CreateTextCheckingResults(SpellCheck::DO_NOT_MODIFY, | 256 spellcheck_->CreateTextCheckingResults(SpellCheck::DO_NOT_MODIFY, |
| 257 0, | 257 0, |
| 258 line, | 258 line, |
| 259 results, | 259 results, |
| 260 &textcheck_results); | 260 &textcheck_results); |
| 261 completion->didFinishCheckingText(textcheck_results); | 261 completion->didFinishCheckingText(textcheck_results); |
| 262 | 262 |
| 263 // TODO(groby): Add request caching once OSX reports back original request. | |
| 264 // (cf. SpellCheckProvider::OnRespondSpellingService) | |
| 265 // Cache the request and the converted results. | 263 // Cache the request and the converted results. |
| 264 last_request_ = line; | |
|
groby-ooo-7-16
2016/09/09 22:41:38
Did you verify OSX actually returns the original r
timvolodine
2016/09/12 15:31:39
Yes, tested this on Mac OS X, it does return the "
| |
| 265 last_results_.swap(textcheck_results); | |
| 266 } | 266 } |
| 267 | 267 |
| 268 void SpellCheckProvider::OnToggleSpellPanel(bool is_currently_visible) { | 268 void SpellCheckProvider::OnToggleSpellPanel(bool is_currently_visible) { |
| 269 if (!render_view()->GetWebView()) | 269 if (!render_view()->GetWebView()) |
| 270 return; | 270 return; |
| 271 // We need to tell the webView whether the spelling panel is visible or not so | 271 // We need to tell the webView whether the spelling panel is visible or not so |
| 272 // that it won't need to make ipc calls later. | 272 // that it won't need to make ipc calls later. |
| 273 spelling_panel_visible_ = is_currently_visible; | 273 spelling_panel_visible_ = is_currently_visible; |
| 274 render_view()->GetWebView()->focusedFrame()->executeCommand( | 274 render_view()->GetWebView()->focusedFrame()->executeCommand( |
| 275 WebString::fromUTF8("ToggleSpellPanel")); | 275 WebString::fromUTF8("ToggleSpellPanel")); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 return true; | 341 return true; |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 return false; | 345 return false; |
| 346 } | 346 } |
| 347 | 347 |
| 348 void SpellCheckProvider::OnDestruct() { | 348 void SpellCheckProvider::OnDestruct() { |
| 349 delete this; | 349 delete this; |
| 350 } | 350 } |
| OLD | NEW |