| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test_runner/spell_check_client.h" | 5 #include "components/test_runner/spell_check_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 result.length = misspelled_length; | 63 result.length = misspelled_length; |
| 64 results.push_back(result); | 64 results.push_back(result); |
| 65 offset += misspelled_position + misspelled_length; | 65 offset += misspelled_position + misspelled_length; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 web_results->assign(results); | 68 web_results->assign(results); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void SpellCheckClient::requestCheckingOfText( | 71 void SpellCheckClient::requestCheckingOfText( |
| 72 const blink::WebString& text, | 72 const blink::WebString& text, |
| 73 const blink::WebVector<uint32_t>& markers, | |
| 74 const blink::WebVector<unsigned>& marker_offsets, | |
| 75 blink::WebTextCheckingCompletion* completion) { | 73 blink::WebTextCheckingCompletion* completion) { |
| 76 if (text.isEmpty()) { | 74 if (text.isEmpty()) { |
| 77 if (completion) | 75 if (completion) |
| 78 completion->didCancelCheckingText(); | 76 completion->didCancelCheckingText(); |
| 79 return; | 77 return; |
| 80 } | 78 } |
| 81 | 79 |
| 82 if (last_requested_text_checking_completion_) | 80 if (last_requested_text_checking_completion_) |
| 83 last_requested_text_checking_completion_->didCancelCheckingText(); | 81 last_requested_text_checking_completion_->didCancelCheckingText(); |
| 84 | 82 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 119 } |
| 122 } | 120 } |
| 123 last_requested_text_checking_completion_->didFinishCheckingText(results); | 121 last_requested_text_checking_completion_->didFinishCheckingText(results); |
| 124 last_requested_text_checking_completion_ = 0; | 122 last_requested_text_checking_completion_ = 0; |
| 125 | 123 |
| 126 if (test_runner_->shouldDumpSpellCheckCallbacks()) | 124 if (test_runner_->shouldDumpSpellCheckCallbacks()) |
| 127 delegate_->PrintMessage("SpellCheckEvent: FinishLastTextCheck\n"); | 125 delegate_->PrintMessage("SpellCheckEvent: FinishLastTextCheck\n"); |
| 128 } | 126 } |
| 129 | 127 |
| 130 } // namespace test_runner | 128 } // namespace test_runner |
| OLD | NEW |