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

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: Blacklist extension window. Created 4 years, 6 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 TextInputType GetTextInputType() const override; 51 TextInputType GetTextInputType() const override;
52 TextInputMode GetTextInputMode() const override; 52 TextInputMode GetTextInputMode() const override;
53 int GetTextInputFlags() const override; 53 int GetTextInputFlags() const override;
54 bool CanComposeInline() const override; 54 bool CanComposeInline() const override;
55 void ShowImeIfNeeded() override; 55 void ShowImeIfNeeded() override;
56 56
57 void AddObserver(InputMethodObserver* observer) override; 57 void AddObserver(InputMethodObserver* observer) override;
58 void RemoveObserver(InputMethodObserver* observer) override; 58 void RemoveObserver(InputMethodObserver* observer) override;
59 59
60 std::vector<ui::KeyEvent*> GetKeyEventsForTest() override;
61
60 protected: 62 protected:
61 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before, 63 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
62 TextInputClient* focused) {} 64 TextInputClient* focused) {}
63 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, 65 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
64 TextInputClient* focused) {} 66 TextInputClient* focused) {}
65 67
66 // IMEInputContextHandlerInterface: 68 // IMEInputContextHandlerInterface:
67 void CommitText(const std::string& text) override; 69 void CommitText(const std::string& text) override;
68 void UpdateCompositionText(const CompositionText& text, 70 void UpdateCompositionText(const CompositionText& text,
69 uint32_t cursor_pos, 71 uint32_t cursor_pos,
70 bool visible) override; 72 bool visible) override;
71 void DeleteSurroundingText(int32_t offset, uint32_t length) override; 73 void DeleteSurroundingText(int32_t offset, uint32_t length) override;
72 void SendKeyEvent(KeyEvent* event) override; 74 void SendKeyEvent(KeyEvent* event) override;
75 InputMethod* GetInputMethod() override;
73 76
74 // Sends a fake key event for IME composing without physical key events. 77 // Sends a fake key event for IME composing without physical key events.
75 // Returns true if the faked key event is stopped propagation. 78 // Returns true if the faked key event is stopped propagation.
76 bool SendFakeProcessKeyEvent(bool pressed) const; 79 bool SendFakeProcessKeyEvent(bool pressed) const;
77 80
78 // Returns true if |client| is currently focused. 81 // Returns true if |client| is currently focused.
79 bool IsTextInputClientFocused(const TextInputClient* client); 82 bool IsTextInputClientFocused(const TextInputClient* client);
80 83
81 // Checks if the focused text input client's text input type is 84 // 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 85 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text
(...skipping 25 matching lines...) Expand all
108 bool sending_key_event_; 111 bool sending_key_event_;
109 112
110 private: 113 private:
111 void SetFocusedTextInputClientInternal(TextInputClient* client); 114 void SetFocusedTextInputClientInternal(TextInputClient* client);
112 115
113 internal::InputMethodDelegate* delegate_; 116 internal::InputMethodDelegate* delegate_;
114 TextInputClient* text_input_client_; 117 TextInputClient* text_input_client_;
115 118
116 base::ObserverList<InputMethodObserver> observer_list_; 119 base::ObserverList<InputMethodObserver> observer_list_;
117 120
121 std::vector<ui::KeyEvent*> key_events_for_test;
122
118 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); 123 DISALLOW_COPY_AND_ASSIGN(InputMethodBase);
119 }; 124 };
120 125
121 } // namespace ui 126 } // namespace ui
122 127
123 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ 128 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698