| 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/renderer/spellchecker/spellcheck_provider.h" | 5 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/spellcheck_marker.h" | 10 #include "chrome/common/spellcheck_marker.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 void SpellCheckProvider::OnRespondTextCheck( | 265 void SpellCheckProvider::OnRespondTextCheck( |
| 266 int identifier, | 266 int identifier, |
| 267 const base::string16& line, | 267 const base::string16& line, |
| 268 const std::vector<SpellCheckResult>& results) { | 268 const std::vector<SpellCheckResult>& results) { |
| 269 // TODO(groby): Unify with SpellCheckProvider::OnRespondSpellingService | 269 // TODO(groby): Unify with SpellCheckProvider::OnRespondSpellingService |
| 270 DCHECK(spellcheck_); | 270 DCHECK(spellcheck_); |
| 271 WebTextCheckingCompletion* completion = | 271 WebTextCheckingCompletion* completion = |
| 272 text_check_completions_.Lookup(identifier); | 272 text_check_completions_.Lookup(identifier); |
| 273 if (!completion) | 273 if (!completion){ |
| 274 LOG(ERROR) << "DYLANKING In OnRespondTextCheck Early Return"; |
| 274 return; | 275 return; |
| 276 } |
| 275 text_check_completions_.Remove(identifier); | 277 text_check_completions_.Remove(identifier); |
| 276 blink::WebVector<blink::WebTextCheckingResult> textcheck_results; | 278 blink::WebVector<blink::WebTextCheckingResult> textcheck_results; |
| 279 LOG(ERROR) << "DYLANKING In OnRespondTextCheck, Calling CreateTextCheckingResu
lts"; |
| 277 spellcheck_->CreateTextCheckingResults(SpellCheck::DO_NOT_MODIFY, | 280 spellcheck_->CreateTextCheckingResults(SpellCheck::DO_NOT_MODIFY, |
| 278 0, | 281 0, |
| 279 line, | 282 line, |
| 280 results, | 283 results, |
| 281 &textcheck_results); | 284 &textcheck_results); |
| 282 completion->didFinishCheckingText(textcheck_results); | 285 completion->didFinishCheckingText(textcheck_results); |
| 283 | 286 |
| 284 // TODO(groby): Add request caching once OSX reports back original request. | 287 // TODO(groby): Add request caching once OSX reports back original request. |
| 285 // (cf. SpellCheckProvider::OnRespondSpellingService) | 288 // (cf. SpellCheckProvider::OnRespondSpellingService) |
| 286 // Cache the request and the converted results. | 289 // Cache the request and the converted results. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 results[i].length = last_results_[i].length; | 356 results[i].length = last_results_[i].length; |
| 354 results[i].replacement = last_results_[i].replacement; | 357 results[i].replacement = last_results_[i].replacement; |
| 355 } | 358 } |
| 356 completion->didFinishCheckingText(results); | 359 completion->didFinishCheckingText(results); |
| 357 return true; | 360 return true; |
| 358 } | 361 } |
| 359 } | 362 } |
| 360 | 363 |
| 361 return false; | 364 return false; |
| 362 } | 365 } |
| OLD | NEW |