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_provider.h" | 5 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/common/spellcheck_messages.h" | 10 #include "chrome/common/spellcheck_messages.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 int(SpellCheckResult::SHOWCORRECTIONPANEL), mismatching_enums); | 43 int(SpellCheckResult::SHOWCORRECTIONPANEL), mismatching_enums); |
44 | 44 |
45 SpellCheckProvider::SpellCheckProvider( | 45 SpellCheckProvider::SpellCheckProvider( |
46 content::RenderView* render_view, | 46 content::RenderView* render_view, |
47 SpellCheck* spellcheck) | 47 SpellCheck* spellcheck) |
48 : content::RenderViewObserver(render_view), | 48 : content::RenderViewObserver(render_view), |
49 content::RenderViewObserverTracker<SpellCheckProvider>(render_view), | 49 content::RenderViewObserverTracker<SpellCheckProvider>(render_view), |
50 spelling_panel_visible_(false), | 50 spelling_panel_visible_(false), |
51 spellcheck_(spellcheck) { | 51 spellcheck_(spellcheck) { |
52 DCHECK(spellcheck_); | 52 DCHECK(spellcheck_); |
53 if (render_view) { // NULL in unit tests. | 53 if (render_view) { // NULL in unit tests. |
54 render_view->GetWebView()->setSpellCheckClient(this); | 54 render_view->GetWebView()->setSpellCheckClient(this); |
55 EnableSpellcheck(spellcheck_->is_spellcheck_enabled()); | 55 EnableSpellcheck(spellcheck_->is_spellcheck_enabled()); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 SpellCheckProvider::~SpellCheckProvider() { | 59 SpellCheckProvider::~SpellCheckProvider() { |
60 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
61 Send(new SpellCheckHostMsg_DocumentClosed(routing_id(), routing_id())); | 61 Send(new SpellCheckHostMsg_DocumentClosed(routing_id(), routing_id())); |
62 #endif | 62 #endif |
63 } | 63 } |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 results[i].replacement = last_results_[i].replacement; | 349 results[i].replacement = last_results_[i].replacement; |
350 } | 350 } |
351 completion->didFinishCheckingText(results); | 351 completion->didFinishCheckingText(results); |
352 return true; | 352 return true; |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 return false; | 356 return false; |
357 } | 357 } |
358 #endif | 358 #endif |
OLD | NEW |