Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: chrome/renderer/spellchecker/spellcheck.cc

Issue 1210943008: Patch 2: Added a preprocessor flag for platform spellcheck. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_spellcheck_flag
Patch Set: Declared the preprocessor flag in build/config/features.gni Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/spellcheck_messages.h ('k') | chrome/renderer/spellchecker/spellcheck_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "chrome/renderer/spellchecker/spellcheck.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 void SpellCheck::PostDelayedSpellCheckTask(SpellcheckRequest* request) { 379 void SpellCheck::PostDelayedSpellCheckTask(SpellcheckRequest* request) {
380 if (!request) 380 if (!request)
381 return; 381 return;
382 382
383 base::ThreadTaskRunnerHandle::Get()->PostTask( 383 base::ThreadTaskRunnerHandle::Get()->PostTask(
384 FROM_HERE, base::Bind(&SpellCheck::PerformSpellCheck, AsWeakPtr(), 384 FROM_HERE, base::Bind(&SpellCheck::PerformSpellCheck, AsWeakPtr(),
385 base::Owned(request))); 385 base::Owned(request)));
386 } 386 }
387 #endif 387 #endif
388 388
389 #if !defined(OS_MACOSX) // Mac uses its native engine instead. 389 #if !defined(OS_MACOSX) // Mac uses its platform engine instead.
390 void SpellCheck::PerformSpellCheck(SpellcheckRequest* param) { 390 void SpellCheck::PerformSpellCheck(SpellcheckRequest* param) {
391 DCHECK(param); 391 DCHECK(param);
392 392
393 if (!spellcheck_.IsEnabled()) { 393 if (!spellcheck_.IsEnabled()) {
394 param->completion()->didCancelCheckingText(); 394 param->completion()->didCancelCheckingText();
395 } else { 395 } else {
396 WebVector<blink::WebTextCheckingResult> results; 396 WebVector<blink::WebTextCheckingResult> results;
397 SpellCheckParagraph(param->text(), &results); 397 SpellCheckParagraph(param->text(), &results);
398 param->completion()->didFinishCheckingText(results); 398 param->completion()->didFinishCheckingText(results);
399 } 399 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 451
452 results.push_back(WebTextCheckingResult( 452 results.push_back(WebTextCheckingResult(
453 static_cast<WebTextDecorationType>(decoration), 453 static_cast<WebTextDecorationType>(decoration),
454 line_offset + spellcheck_result.location, spellcheck_result.length, 454 line_offset + spellcheck_result.location, spellcheck_result.length,
455 replacement, spellcheck_result.hash)); 455 replacement, spellcheck_result.hash));
456 } 456 }
457 457
458 textcheck_results->assign(results); 458 textcheck_results->assign(results);
459 } 459 }
OLDNEW
« no previous file with comments | « chrome/common/spellcheck_messages.h ('k') | chrome/renderer/spellchecker/spellcheck_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698