| 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.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" |
| 11 #include "base/command_line.h" |
| 11 #include "base/location.h" | 12 #include "base/location.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 14 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
| 16 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/spellcheck_common.h" | 17 #include "chrome/common/spellcheck_common.h" |
| 16 #include "chrome/common/spellcheck_messages.h" | 18 #include "chrome/common/spellcheck_messages.h" |
| 17 #include "chrome/common/spellcheck_result.h" | 19 #include "chrome/common/spellcheck_result.h" |
| 18 #include "chrome/renderer/spellchecker/spellcheck_language.h" | 20 #include "chrome/renderer/spellchecker/spellcheck_language.h" |
| 19 #include "chrome/renderer/spellchecker/spellcheck_provider.h" | 21 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
| 20 #include "content/public/renderer/render_thread.h" | 22 #include "content/public/renderer/render_thread.h" |
| 21 #include "content/public/renderer/render_view.h" | 23 #include "content/public/renderer/render_view.h" |
| 22 #include "content/public/renderer/render_view_visitor.h" | 24 #include "content/public/renderer/render_view_visitor.h" |
| 23 #include "ipc/ipc_platform_file.h" | 25 #include "ipc/ipc_platform_file.h" |
| 24 #include "third_party/WebKit/public/platform/WebString.h" | 26 #include "third_party/WebKit/public/platform/WebString.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 } | 472 } |
| 471 | 473 |
| 472 results.push_back(WebTextCheckingResult( | 474 results.push_back(WebTextCheckingResult( |
| 473 static_cast<WebTextDecorationType>(decoration), | 475 static_cast<WebTextDecorationType>(decoration), |
| 474 line_offset + spellcheck_result.location, spellcheck_result.length, | 476 line_offset + spellcheck_result.location, spellcheck_result.length, |
| 475 replacement, spellcheck_result.hash)); | 477 replacement, spellcheck_result.hash)); |
| 476 } | 478 } |
| 477 | 479 |
| 478 textcheck_results->assign(results); | 480 textcheck_results->assign(results); |
| 479 } | 481 } |
| 482 |
| 483 bool SpellCheck::IsSpellcheckEnabled() { |
| 484 #if defined(OS_ANDROID) |
| 485 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 486 switches::kEnableAndroidSpellChecker)) { |
| 487 return false; |
| 488 } |
| 489 #endif |
| 490 return spellcheck_enabled_; |
| 491 } |
| OLD | NEW |