OLD | NEW |
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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Checks if the focused text input client's text input type is | 65 // Checks if the focused text input client's text input type is |
66 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text | 66 // TEXT_INPUT_TYPE_NONE. Also returns true if there is no focused text |
67 // input client. | 67 // input client. |
68 bool IsTextInputTypeNone() const; | 68 bool IsTextInputTypeNone() const; |
69 | 69 |
70 // Convenience method to call the focused text input client's | 70 // Convenience method to call the focused text input client's |
71 // OnInputMethodChanged() method. It'll only take effect if the current text | 71 // OnInputMethodChanged() method. It'll only take effect if the current text |
72 // input type is not TEXT_INPUT_TYPE_NONE. | 72 // input type is not TEXT_INPUT_TYPE_NONE. |
73 void OnInputMethodChanged() const; | 73 void OnInputMethodChanged() const; |
74 | 74 |
75 // Convenience method to call delegate_->DispatchKeyEventPostIME(). | 75 // Convenience method to call delegate_->DispatchKeyEventPostIME() |
76 // Returns true if the event was processed | 76 // or delegate_->DispatchFabricatedKeyEventPostIME() considering if |
77 bool DispatchKeyEventPostIME(const base::NativeEvent& native_event) const; | 77 // |event| contains the native event or not. Returns true if the |
78 | 78 // event was processed. |
79 // Convenience method to call delegate_->DispatchFabricatedKeyEventPostIME(). | 79 bool DispatchKeyEventPostIME(const ui::KeyEvent& event) const; |
80 // Returns true if the event was processed | |
81 bool DispatchFabricatedKeyEventPostIME(EventType type, | |
82 KeyboardCode key_code, | |
83 int flags) const; | |
84 | 80 |
85 // Convenience method to notify all observers of TextInputClient changes. | 81 // Convenience method to notify all observers of TextInputClient changes. |
86 void NotifyTextInputStateChanged(const TextInputClient* client); | 82 void NotifyTextInputStateChanged(const TextInputClient* client); |
87 | 83 |
88 bool system_toplevel_window_focused() const { | 84 bool system_toplevel_window_focused() const { |
89 return system_toplevel_window_focused_; | 85 return system_toplevel_window_focused_; |
90 } | 86 } |
91 | 87 |
92 private: | 88 private: |
93 void SetFocusedTextInputClientInternal(TextInputClient* client); | 89 void SetFocusedTextInputClientInternal(TextInputClient* client); |
94 | 90 |
95 internal::InputMethodDelegate* delegate_; | 91 internal::InputMethodDelegate* delegate_; |
96 TextInputClient* text_input_client_; | 92 TextInputClient* text_input_client_; |
97 | 93 |
98 ObserverList<InputMethodObserver> observer_list_; | 94 ObserverList<InputMethodObserver> observer_list_; |
99 | 95 |
100 bool system_toplevel_window_focused_; | 96 bool system_toplevel_window_focused_; |
101 | 97 |
102 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); | 98 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); |
103 }; | 99 }; |
104 | 100 |
105 } // namespace ui | 101 } // namespace ui |
106 | 102 |
107 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ | 103 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ |
OLD | NEW |