| 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_provider.h" | 5 #include "components/spellcheck/renderer/spellcheck_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "components/spellcheck/common/spellcheck_messages.h" | 9 #include "components/spellcheck/common/spellcheck_messages.h" |
| 10 #include "components/spellcheck/common/spellcheck_result.h" | 10 #include "components/spellcheck/common/spellcheck_result.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 SpellCheckProvider::SpellCheckProvider( | 37 SpellCheckProvider::SpellCheckProvider( |
| 38 content::RenderView* render_view, | 38 content::RenderView* render_view, |
| 39 SpellCheck* spellcheck) | 39 SpellCheck* spellcheck) |
| 40 : content::RenderViewObserver(render_view), | 40 : content::RenderViewObserver(render_view), |
| 41 content::RenderViewObserverTracker<SpellCheckProvider>(render_view), | 41 content::RenderViewObserverTracker<SpellCheckProvider>(render_view), |
| 42 spelling_panel_visible_(false), | 42 spelling_panel_visible_(false), |
| 43 spellcheck_(spellcheck) { | 43 spellcheck_(spellcheck) { |
| 44 DCHECK(spellcheck_); | 44 DCHECK(spellcheck_); |
| 45 if (render_view) { // NULL in unit tests. | 45 if (render_view) { // NULL in unit tests. |
| 46 render_view->GetWebView()->setSpellCheckClient(this); | 46 render_view->GetWebView()->setSpellCheckClient(this); |
| 47 render_view->GetWebView()->setTextCheckClient(this); |
| 47 EnableSpellcheck(spellcheck_->IsSpellcheckEnabled()); | 48 EnableSpellcheck(spellcheck_->IsSpellcheckEnabled()); |
| 48 } | 49 } |
| 49 } | 50 } |
| 50 | 51 |
| 51 SpellCheckProvider::~SpellCheckProvider() { | 52 SpellCheckProvider::~SpellCheckProvider() { |
| 52 } | 53 } |
| 53 | 54 |
| 54 void SpellCheckProvider::RequestTextChecking( | 55 void SpellCheckProvider::RequestTextChecking( |
| 55 const base::string16& text, | 56 const base::string16& text, |
| 56 WebTextCheckingCompletion* completion) { | 57 WebTextCheckingCompletion* completion) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 completion->didFinishCheckingText(results); | 319 completion->didFinishCheckingText(results); |
| 319 return true; | 320 return true; |
| 320 } | 321 } |
| 321 | 322 |
| 322 return false; | 323 return false; |
| 323 } | 324 } |
| 324 | 325 |
| 325 void SpellCheckProvider::OnDestruct() { | 326 void SpellCheckProvider::OnDestruct() { |
| 326 delete this; | 327 delete this; |
| 327 } | 328 } |
| OLD | NEW |