Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: third_party/WebKit/Source/web/WebInputMethodControllerImpl.h

Issue 2333813002: Introduce WebInputMethodController to blink (Closed)
Patch Set: Explicitly asking for TextInputState updates Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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(const WebString& text,
31 const WebVector<WebCompositionUnderline>& underlines,
32 int selectionStart,
33 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(
43 ConfirmCompositionBehavior selectionBehavior) override;
44
45 void setSuppressNextKeypressEvent(bool suppress) {
46 m_suppressNextKeypressEvent = suppress;
47 }
48
49 DECLARE_TRACE();
50
51 private:
52 LocalFrame* frame() const;
53 InputMethodController& inputMethodController() const;
54 WebPlugin* focusedPluginIfInputMethodSupported() const;
55
56 WeakMember<WebLocalFrameImpl> m_webLocalFrame;
57 bool m_suppressNextKeypressEvent;
58 };
59 } // namespace blink
60
61 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698