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

Side by Side Diff: ui/base/ime/input_method_base.h

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 months 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
« no previous file with comments | « ui/base/ime/input_method_auralinux.cc ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_BASE_IME_INPUT_METHOD_BASE_H_ 5 #ifndef UI_BASE_IME_INPUT_METHOD_BASE_H_
6 #define UI_BASE_IME_INPUT_METHOD_BASE_H_ 6 #define UI_BASE_IME_INPUT_METHOD_BASE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 TextInputClient* focused) {} 62 TextInputClient* focused) {}
63 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, 63 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
64 TextInputClient* focused) {} 64 TextInputClient* focused) {}
65 65
66 // IMEInputContextHandlerInterface: 66 // IMEInputContextHandlerInterface:
67 void CommitText(const std::string& text) override; 67 void CommitText(const std::string& text) override;
68 void UpdateCompositionText(const CompositionText& text, 68 void UpdateCompositionText(const CompositionText& text,
69 uint32_t cursor_pos, 69 uint32_t cursor_pos,
70 bool visible) override; 70 bool visible) override;
71 void DeleteSurroundingText(int32_t offset, uint32_t length) override; 71 void DeleteSurroundingText(int32_t offset, uint32_t length) override;
72 void SendKeyEvent(KeyEvent* event) override;
72 73
73 // Sends a fake key event for IME composing without physical key events. 74 // Sends a fake key event for IME composing without physical key events.
74 // Returns true if the faked key event is stopped propagation. 75 // Returns true if the faked key event is stopped propagation.
75 bool SendFakeProcessKeyEvent(bool pressed) const; 76 bool SendFakeProcessKeyEvent(bool pressed) const;
76 77
77 // Returns true if |client| is currently focused. 78 // Returns true if |client| is currently focused.
78 bool IsTextInputClientFocused(const TextInputClient* client); 79 bool IsTextInputClientFocused(const TextInputClient* client);
79 80
80 // Checks if the focused text input client's text input type is 81 // Checks if the focused text input client's text input type is
81 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text 82 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text
(...skipping 13 matching lines...) Expand all
95 // Convenience method to notify all observers of TextInputClient changes. 96 // Convenience method to notify all observers of TextInputClient changes.
96 void NotifyTextInputStateChanged(const TextInputClient* client); 97 void NotifyTextInputStateChanged(const TextInputClient* client);
97 98
98 // Convenience method to notify all observers of CaretBounds changes on 99 // Convenience method to notify all observers of CaretBounds changes on
99 // |client| which is the text input client with focus. 100 // |client| which is the text input client with focus.
100 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client); 101 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client);
101 102
102 // Gets the bounds of the composition text or cursor in |client|. 103 // Gets the bounds of the composition text or cursor in |client|.
103 std::vector<gfx::Rect> GetCompositionBounds(const TextInputClient* client); 104 std::vector<gfx::Rect> GetCompositionBounds(const TextInputClient* client);
104 105
106 // Indicates whether the IME extension is currently sending a fake key event.
107 // This is used in SendKeyEvent.
108 bool sending_key_event_;
109
105 private: 110 private:
106 void SetFocusedTextInputClientInternal(TextInputClient* client); 111 void SetFocusedTextInputClientInternal(TextInputClient* client);
107 112
108 internal::InputMethodDelegate* delegate_; 113 internal::InputMethodDelegate* delegate_;
109 TextInputClient* text_input_client_; 114 TextInputClient* text_input_client_;
110 115
111 base::ObserverList<InputMethodObserver> observer_list_; 116 base::ObserverList<InputMethodObserver> observer_list_;
112 117
113 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); 118 DISALLOW_COPY_AND_ASSIGN(InputMethodBase);
114 }; 119 };
115 120
116 } // namespace ui 121 } // namespace ui
117 122
118 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ 123 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_auralinux.cc ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698