OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef TextSuggestionController_h | |
6 #define TextSuggestionController_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 #include "core/dom/DocumentShutdownObserver.h" | |
10 #include "platform/heap/Handle.h" | |
11 #include "public/platform/input_host.mojom-blink.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class Document; | |
16 class LocalFrame; | |
17 | |
18 // This class handles functionality related to displaying a menu of text | |
19 // suggestions (e.g. from spellcheck), and performing actions relating to those | |
20 // suggestions. Android is currently the only platform that has such a menu. | |
21 class CORE_EXPORT TextSuggestionController final | |
22 : public GarbageCollectedFinalized<TextSuggestionController>, | |
23 public DocumentShutdownObserver { | |
24 WTF_MAKE_NONCOPYABLE(TextSuggestionController); | |
yosin_UTC9
2017/06/16 01:21:04
Let's use DISALLOW_COPY_AND_ASSIGN()
| |
25 USING_GARBAGE_COLLECTED_MIXIN(TextSuggestionController); | |
26 | |
27 public: | |
28 explicit TextSuggestionController(LocalFrame&); | |
29 | |
30 void DocumentAttached(Document*); | |
31 | |
32 bool IsMenuOpen() const; | |
33 | |
34 void HandlePotentialMisspelledWordTap(); | |
35 | |
36 void ApplySpellCheckSuggestion(const WTF::String& suggestion); | |
37 void DeleteActiveSuggestionRange(); | |
38 void NewWordAddedToDictionary(const WTF::String& word); | |
39 void SpellCheckMenuTimeoutCallback(); | |
40 void SuggestionMenuClosed(); | |
41 | |
42 DECLARE_TRACE(); | |
43 | |
44 private: | |
45 Document& GetDocument() const; | |
46 bool IsAvailable() const; | |
47 | |
48 LocalFrame& GetFrame() const { | |
49 DCHECK(frame_); | |
50 return *frame_; | |
51 } | |
52 | |
53 void ReplaceActiveSuggestionRange(const String&); | |
54 | |
55 bool suggestion_menu_is_open_; | |
56 Member<LocalFrame> frame_; | |
57 mojom::blink::TextSuggestionHostPtr text_suggestion_host_; | |
58 }; | |
59 | |
60 } // namespace blink | |
61 | |
62 #endif // TextSuggestionController_h | |
OLD | NEW |