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

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

Issue 2077783002: Make limitations for input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos error. Created 4 years, 5 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.h ('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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void SendKeyEvent(KeyEvent* event) override;
73 InputMethod* GetInputMethod() override;
73 74
74 // Sends a fake key event for IME composing without physical key events. 75 // Sends a fake key event for IME composing without physical key events.
75 // Returns true if the faked key event is stopped propagation. 76 // Returns true if the faked key event is stopped propagation.
76 bool SendFakeProcessKeyEvent(bool pressed) const; 77 bool SendFakeProcessKeyEvent(bool pressed) const;
77 78
78 // Returns true if |client| is currently focused. 79 // Returns true if |client| is currently focused.
79 bool IsTextInputClientFocused(const TextInputClient* client); 80 bool IsTextInputClientFocused(const TextInputClient* client);
80 81
81 // Checks if the focused text input client's text input type is 82 // Checks if the focused text input client's text input type is
82 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text 83 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text
(...skipping 18 matching lines...) Expand all
101 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client); 102 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client);
102 103
103 // Gets the bounds of the composition text or cursor in |client|. 104 // Gets the bounds of the composition text or cursor in |client|.
104 std::vector<gfx::Rect> GetCompositionBounds(const TextInputClient* client); 105 std::vector<gfx::Rect> GetCompositionBounds(const TextInputClient* client);
105 106
106 // Indicates whether the IME extension is currently sending a fake key event. 107 // Indicates whether the IME extension is currently sending a fake key event.
107 // This is used in SendKeyEvent. 108 // This is used in SendKeyEvent.
108 bool sending_key_event_; 109 bool sending_key_event_;
109 110
110 private: 111 private:
112 // InputMethod:
113 const std::vector<std::unique_ptr<ui::KeyEvent>>& GetKeyEventsForTesting()
114 override;
115
111 void SetFocusedTextInputClientInternal(TextInputClient* client); 116 void SetFocusedTextInputClientInternal(TextInputClient* client);
112 117
113 internal::InputMethodDelegate* delegate_; 118 internal::InputMethodDelegate* delegate_;
114 TextInputClient* text_input_client_; 119 TextInputClient* text_input_client_;
115 120
116 base::ObserverList<InputMethodObserver> observer_list_; 121 base::ObserverList<InputMethodObserver> observer_list_;
117 122
123 std::vector<std::unique_ptr<ui::KeyEvent>> key_events_for_testing_;
124
118 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); 125 DISALLOW_COPY_AND_ASSIGN(InputMethodBase);
119 }; 126 };
120 127
121 } // namespace ui 128 } // namespace ui
122 129
123 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ 130 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_
OLDNEW
« no previous file with comments | « ui/base/ime/input_method.h ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698