| 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 "components/spellcheck/renderer/spellcheck.h" | 5 #include "components/spellcheck/renderer/spellcheck.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "components/spellcheck/common/spellcheck_common.h" | 21 #include "components/spellcheck/common/spellcheck_common.h" |
| 22 #include "components/spellcheck/common/spellcheck_features.h" |
| 22 #include "components/spellcheck/common/spellcheck_messages.h" | 23 #include "components/spellcheck/common/spellcheck_messages.h" |
| 23 #include "components/spellcheck/common/spellcheck_result.h" | 24 #include "components/spellcheck/common/spellcheck_result.h" |
| 24 #include "components/spellcheck/common/spellcheck_switches.h" | 25 #include "components/spellcheck/common/spellcheck_switches.h" |
| 25 #include "components/spellcheck/renderer/spellcheck_language.h" | 26 #include "components/spellcheck/renderer/spellcheck_language.h" |
| 26 #include "components/spellcheck/renderer/spellcheck_provider.h" | 27 #include "components/spellcheck/renderer/spellcheck_provider.h" |
| 27 #include "content/public/renderer/render_thread.h" | 28 #include "content/public/renderer/render_thread.h" |
| 28 #include "content/public/renderer/render_view.h" | 29 #include "content/public/renderer/render_view.h" |
| 29 #include "content/public/renderer/render_view_visitor.h" | 30 #include "content/public/renderer/render_view_visitor.h" |
| 30 #include "ipc/ipc_platform_file.h" | 31 #include "ipc/ipc_platform_file.h" |
| 31 #include "third_party/WebKit/public/platform/WebString.h" | 32 #include "third_party/WebKit/public/platform/WebString.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 static_cast<WebTextDecorationType>(decoration), | 531 static_cast<WebTextDecorationType>(decoration), |
| 531 line_offset + spellcheck_result.location, spellcheck_result.length, | 532 line_offset + spellcheck_result.location, spellcheck_result.length, |
| 532 replacement, spellcheck_result.hash)); | 533 replacement, spellcheck_result.hash)); |
| 533 } | 534 } |
| 534 | 535 |
| 535 textcheck_results->assign(results); | 536 textcheck_results->assign(results); |
| 536 } | 537 } |
| 537 | 538 |
| 538 bool SpellCheck::IsSpellcheckEnabled() { | 539 bool SpellCheck::IsSpellcheckEnabled() { |
| 539 #if defined(OS_ANDROID) | 540 #if defined(OS_ANDROID) |
| 540 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 541 if (!spellcheck::IsAndroidSpellCheckFeatureEnabled()) return false; |
| 541 spellcheck::switches::kEnableAndroidSpellChecker)) { | |
| 542 return false; | |
| 543 } | |
| 544 #endif | 542 #endif |
| 545 return spellcheck_enabled_; | 543 return spellcheck_enabled_; |
| 546 } | 544 } |
| OLD | NEW |