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 "public/web/WebCompositionUnderline.h" |
| 10 #include "public/web/WebInputMethodController.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class InputMethodController; |
| 15 class LocalFrame; |
| 16 class WebLocalFrameImpl; |
| 17 class WebPlugin; |
| 18 class WebString; |
| 19 |
| 20 class WebInputMethodControllerImpl : public WebInputMethodController { |
| 21 WTF_MAKE_NONCOPYABLE(WebInputMethodControllerImpl); |
| 22 |
| 23 public: |
| 24 explicit WebInputMethodControllerImpl(WebLocalFrameImpl* ownerFrame); |
| 25 ~WebInputMethodControllerImpl() override; |
| 26 |
| 27 static WebInputMethodControllerImpl* fromFrame(LocalFrame*); |
| 28 |
| 29 // WebInputMethodController overrides. |
| 30 bool setComposition( |
| 31 const WebString& text, |
| 32 const WebVector<WebCompositionUnderline>& underlines, |
| 33 int selectionStart, int selectionEnd) override; |
| 34 |
| 35 // Used to ask the WebInputMethodController to either delete and ongoing |
| 36 // composition, or insert the specified text, or move the caret according to |
| 37 // relativeCaretPosition. |
| 38 bool commitText(const WebString& text, int relativeCaretPosition) override; |
| 39 |
| 40 // Called to ask the WebInputMethodController to confirm an ongoing |
| 41 // composition. |
| 42 bool finishComposingText(ConfirmCompositionBehavior selectionBehavior) overr
ide; |
| 43 |
| 44 void setSuppressNextKeypressEvent(bool suppress) { m_suppressNextKeypressEve
nt = suppress; } |
| 45 |
| 46 DECLARE_TRACE(); |
| 47 |
| 48 private: |
| 49 LocalFrame* frame() const; |
| 50 InputMethodController& inputMethodController() const; |
| 51 WebPlugin* focusedPluginIfInputMethodSupported() const; |
| 52 |
| 53 WeakMember<WebLocalFrameImpl> m_webLocalFrame; |
| 54 bool m_suppressNextKeypressEvent; |
| 55 }; |
| 56 } // namespace blink |
| 57 |
| 58 #endif |
OLD | NEW |