Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef WebInputMethodControllerImpl_h | 5 #ifndef WebInputMethodControllerImpl_h |
| 6 #define WebInputMethodControllerImpl_h | 6 #define WebInputMethodControllerImpl_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "public/web/WebCompositionUnderline.h" | 9 #include "public/web/WebCompositionUnderline.h" |
| 10 #include "public/web/WebInputMethodController.h" | 10 #include "public/web/WebInputMethodController.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class InputMethodController; | 14 class InputMethodController; |
| 15 class LocalFrame; | 15 class LocalFrame; |
| 16 class WebLocalFrameImpl; | 16 class WebLocalFrameImpl; |
| 17 class WebPlugin; | 17 class WebPlugin; |
| 18 class WebRange; | |
| 18 class WebString; | 19 class WebString; |
| 19 | 20 |
| 20 class WebInputMethodControllerImpl : public WebInputMethodController { | 21 class WebInputMethodControllerImpl : public WebInputMethodController { |
| 21 WTF_MAKE_NONCOPYABLE(WebInputMethodControllerImpl); | 22 WTF_MAKE_NONCOPYABLE(WebInputMethodControllerImpl); |
| 22 | 23 |
| 23 public: | 24 public: |
| 24 explicit WebInputMethodControllerImpl(WebLocalFrameImpl* ownerFrame); | 25 explicit WebInputMethodControllerImpl(WebLocalFrameImpl* ownerFrame); |
| 25 ~WebInputMethodControllerImpl() override; | 26 ~WebInputMethodControllerImpl() override; |
| 26 | 27 |
| 27 static WebInputMethodControllerImpl* fromFrame(LocalFrame*); | 28 static WebInputMethodControllerImpl* fromFrame(LocalFrame*); |
| 28 | 29 |
| 29 // WebInputMethodController overrides. | 30 // WebInputMethodController overrides. |
| 30 bool setComposition(const WebString& text, | 31 bool setComposition(const WebString& text, |
| 31 const WebVector<WebCompositionUnderline>& underlines, | 32 const WebVector<WebCompositionUnderline>& underlines, |
| 33 const WebRange& replacementRange, | |
| 32 int selectionStart, | 34 int selectionStart, |
|
dglazkov
2017/02/07 16:47:45
Would you consider switching selectionStart/select
EhsanK
2017/02/07 17:14:47
Yes definitely. I filed a bug and assigned it to m
| |
| 33 int selectionEnd) override; | 35 int selectionEnd) override; |
| 34 bool commitText(const WebString& text, | 36 bool commitText(const WebString& text, |
| 35 const WebVector<WebCompositionUnderline>& underlines, | 37 const WebVector<WebCompositionUnderline>& underlines, |
| 38 const WebRange& replacementRange, | |
| 36 int relativeCaretPosition) override; | 39 int relativeCaretPosition) override; |
| 37 bool finishComposingText( | 40 bool finishComposingText( |
| 38 ConfirmCompositionBehavior selectionBehavior) override; | 41 ConfirmCompositionBehavior selectionBehavior) override; |
| 39 WebTextInputInfo textInputInfo() override; | 42 WebTextInputInfo textInputInfo() override; |
| 40 WebTextInputType textInputType() override; | 43 WebTextInputType textInputType() override; |
| 41 | 44 |
| 42 void setSuppressNextKeypressEvent(bool suppress) { | 45 void setSuppressNextKeypressEvent(bool suppress) { |
| 43 m_suppressNextKeypressEvent = suppress; | 46 m_suppressNextKeypressEvent = suppress; |
| 44 } | 47 } |
| 45 | 48 |
| 46 DECLARE_TRACE(); | 49 DECLARE_TRACE(); |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 LocalFrame* frame() const; | 52 LocalFrame* frame() const; |
| 50 InputMethodController& inputMethodController() const; | 53 InputMethodController& inputMethodController() const; |
| 51 WebPlugin* focusedPluginIfInputMethodSupported() const; | 54 WebPlugin* focusedPluginIfInputMethodSupported() const; |
| 52 | 55 |
| 53 WeakMember<WebLocalFrameImpl> m_webLocalFrame; | 56 WeakMember<WebLocalFrameImpl> m_webLocalFrame; |
| 54 bool m_suppressNextKeypressEvent; | 57 bool m_suppressNextKeypressEvent; |
| 55 }; | 58 }; |
| 56 } // namespace blink | 59 } // namespace blink |
| 57 | 60 |
| 58 #endif | 61 #endif |
| OLD | NEW |