OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "platform/text/TextCheckerClient.h" | 36 #include "platform/text/TextCheckerClient.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class WebViewImpl; | 40 class WebViewImpl; |
41 | 41 |
42 class SpellCheckerClientImpl final : public SpellCheckerClient, public TextCheck
erClient { | 42 class SpellCheckerClientImpl final : public SpellCheckerClient, public TextCheck
erClient { |
43 public: | 43 public: |
44 explicit SpellCheckerClientImpl(WebViewImpl*); | 44 explicit SpellCheckerClientImpl(WebViewImpl*); |
45 | 45 |
46 virtual ~SpellCheckerClientImpl(); | 46 ~SpellCheckerClientImpl() override; |
47 | 47 |
48 virtual bool isContinuousSpellCheckingEnabled() override; | 48 bool isContinuousSpellCheckingEnabled() override; |
49 virtual void toggleContinuousSpellChecking() override; | 49 void toggleContinuousSpellChecking() override; |
50 virtual bool isGrammarCheckingEnabled() override; | 50 bool isGrammarCheckingEnabled() override; |
51 virtual bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const
override; | 51 bool shouldEraseMarkersAfterChangeSelection(TextCheckingType) const override
; |
52 virtual void checkSpellingOfString(const String&, int* misspellingLocation,
int* misspellingLength) override; | 52 void checkSpellingOfString(const String&, int* misspellingLocation, int* mis
spellingLength) override; |
53 virtual void checkGrammarOfString(const String&, WTF::Vector<GrammarDetail>&
, | 53 void checkGrammarOfString(const String&, Vector<GrammarDetail>&, |
54 int* badGrammarLocation, int* badGrammarLength) override; | 54 int* badGrammarLocation, int* badGrammarLength) override; |
55 virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::Str
ing&) override; | 55 String getAutoCorrectSuggestionForMisspelledWord(const String&) override; |
56 virtual void updateSpellingUIWithMisspelledWord(const WTF::String&) override
; | 56 void updateSpellingUIWithMisspelledWord(const String&) override; |
57 virtual void showSpellingUI(bool show) override; | 57 void showSpellingUI(bool show) override; |
58 virtual bool spellingUIIsShowing() override; | 58 bool spellingUIIsShowing() override; |
59 virtual void requestCheckingOfString(PassRefPtrWillBeRawPtr<TextCheckingRequ
est>) override; | 59 void requestCheckingOfString(PassRefPtrWillBeRawPtr<TextCheckingRequest>) ov
erride; |
60 | 60 |
61 virtual TextCheckerClient& textChecker() override { return *this; } | 61 TextCheckerClient& textChecker() override { return *this; } |
62 | 62 |
63 private: | 63 private: |
64 // Returns whether or not the focused control needs spell-checking. | 64 // Returns whether or not the focused control needs spell-checking. |
65 // Currently, this function just retrieves the focused node and determines | 65 // Currently, this function just retrieves the focused node and determines |
66 // whether or not it is a <textarea> element or an element whose | 66 // whether or not it is a <textarea> element or an element whose |
67 // contenteditable attribute is true. | 67 // contenteditable attribute is true. |
68 // FIXME: Bug 740540: This code just implements the default behavior | 68 // FIXME: Bug 740540: This code just implements the default behavior |
69 // proposed in this issue. We should also retrieve "spellcheck" attributes | 69 // proposed in this issue. We should also retrieve "spellcheck" attributes |
70 // for text fields and create a flag to over-write the default behavior. | 70 // for text fields and create a flag to over-write the default behavior. |
71 bool shouldSpellcheckByDefault(); | 71 bool shouldSpellcheckByDefault(); |
72 | 72 |
73 WebViewImpl* m_webView; | 73 WebViewImpl* m_webView; |
74 | 74 |
75 // This flag is set to false if spell check for this editor is manually | 75 // This flag is set to false if spell check for this editor is manually |
76 // turned off. The default setting is SpellCheckAutomatic. | 76 // turned off. The default setting is SpellCheckAutomatic. |
77 enum { | 77 enum { |
78 SpellCheckAutomatic, | 78 SpellCheckAutomatic, |
79 SpellCheckForcedOn, | 79 SpellCheckForcedOn, |
80 SpellCheckForcedOff | 80 SpellCheckForcedOff |
81 } m_spellCheckThisFieldStatus; | 81 } m_spellCheckThisFieldStatus; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif | 86 #endif |
OLD | NEW |