| 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 // Integration with OS X native spellchecker. | 5 // Integration with OS X native spellchecker. |
| 6 | 6 |
| 7 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 7 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 NSRange range = [SharedSpellChecker() | 65 NSRange range = [SharedSpellChecker() |
| 66 checkSpellingOfString:text_to_check | 66 checkSpellingOfString:text_to_check |
| 67 startingAt:starting_at | 67 startingAt:starting_at |
| 68 language:nil | 68 language:nil |
| 69 wrap:NO | 69 wrap:NO |
| 70 inSpellDocumentWithTag:document_tag | 70 inSpellDocumentWithTag:document_tag |
| 71 wordCount:NULL]; | 71 wordCount:NULL]; |
| 72 if (range.length == 0) | 72 if (range.length == 0) |
| 73 break; | 73 break; |
| 74 check_results.push_back(WebKit::WebTextCheckingResult( | 74 check_results.push_back(WebKit::WebTextCheckingResult( |
| 75 WebKit::WebTextCheckingResult::ErrorSpelling, | 75 WebKit::WebTextCheckingTypeSpelling, |
| 76 range.location, | 76 range.location, |
| 77 range.length)); | 77 range.length)); |
| 78 starting_at = range.location + range.length; | 78 starting_at = range.location + range.length; |
| 79 } | 79 } |
| 80 | 80 |
| 81 destination->Send( | 81 destination->Send( |
| 82 new SpellCheckMsg_RespondTextCheck(route_id, | 82 new SpellCheckMsg_RespondTextCheck(route_id, |
| 83 identifier, | 83 identifier, |
| 84 document_tag, | 84 document_tag, |
| 85 check_results)); | 85 check_results)); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 int identifier, | 277 int identifier, |
| 278 int document_tag, | 278 int document_tag, |
| 279 const string16& text, BrowserMessageFilter* destination) { | 279 const string16& text, BrowserMessageFilter* destination) { |
| 280 BrowserThread::PostTask( | 280 BrowserThread::PostTask( |
| 281 BrowserThread::FILE, FROM_HERE, | 281 BrowserThread::FILE, FROM_HERE, |
| 282 base::Bind(&TextCheckingCallback, make_scoped_refptr(destination), | 282 base::Bind(&TextCheckingCallback, make_scoped_refptr(destination), |
| 283 route_id, identifier, text, document_tag)); | 283 route_id, identifier, text, document_tag)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace spellcheck_mac | 286 } // namespace spellcheck_mac |
| OLD | NEW |