| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 WebInputMethodControllerImpl_h | |
| 6 #define WebInputMethodControllerImpl_h | |
| 7 | |
| 8 #include "platform/heap/Handle.h" | |
| 9 #include "platform/wtf/Allocator.h" | |
| 10 #include "public/web/WebCompositionUnderline.h" | |
| 11 #include "public/web/WebInputMethodController.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class InputMethodController; | |
| 16 class LocalFrame; | |
| 17 class WebLocalFrameImpl; | |
| 18 class WebPlugin; | |
| 19 class WebRange; | |
| 20 class WebString; | |
| 21 | |
| 22 class WebInputMethodControllerImpl : public WebInputMethodController { | |
| 23 WTF_MAKE_NONCOPYABLE(WebInputMethodControllerImpl); | |
| 24 DISALLOW_NEW(); | |
| 25 | |
| 26 public: | |
| 27 explicit WebInputMethodControllerImpl(WebLocalFrameImpl& web_frame); | |
| 28 ~WebInputMethodControllerImpl() override; | |
| 29 | |
| 30 static WebInputMethodControllerImpl* FromFrame(LocalFrame*); | |
| 31 | |
| 32 // WebInputMethodController overrides. | |
| 33 bool SetComposition(const WebString& text, | |
| 34 const WebVector<WebCompositionUnderline>& underlines, | |
| 35 const WebRange& replacement_range, | |
| 36 int selection_start, | |
| 37 int selection_end) override; | |
| 38 bool CommitText(const WebString& text, | |
| 39 const WebVector<WebCompositionUnderline>& underlines, | |
| 40 const WebRange& replacement_range, | |
| 41 int relative_caret_position) override; | |
| 42 bool FinishComposingText( | |
| 43 ConfirmCompositionBehavior selection_behavior) override; | |
| 44 WebTextInputInfo TextInputInfo() override; | |
| 45 WebTextInputType TextInputType() override; | |
| 46 | |
| 47 DECLARE_TRACE(); | |
| 48 | |
| 49 private: | |
| 50 LocalFrame* GetFrame() const; | |
| 51 InputMethodController& GetInputMethodController() const; | |
| 52 WebPlugin* FocusedPluginIfInputMethodSupported() const; | |
| 53 | |
| 54 const Member<WebLocalFrameImpl> web_frame_; | |
| 55 }; | |
| 56 } // namespace blink | |
| 57 | |
| 58 #endif | |
| OLD | NEW |