| 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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "ui/base/ime/input_method.h" | 12 #include "ui/base/ime/input_method.h" |
| 13 #include "ui/base/ime/ui_base_ime_export.h" | 13 #include "ui/base/ime/ui_base_ime_export.h" |
| 14 #include "ui/events/event_dispatcher.h" |
| 14 | 15 |
| 15 namespace gfx { | 16 namespace gfx { |
| 16 class Rect; | 17 class Rect; |
| 17 } // namespace gfx | 18 } // namespace gfx |
| 18 | 19 |
| 19 namespace ui { | 20 namespace ui { |
| 20 | 21 |
| 21 class InputMethodObserver; | 22 class InputMethodObserver; |
| 22 class KeyEvent; | 23 class KeyEvent; |
| 23 class TextInputClient; | 24 class TextInputClient; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // input client. | 70 // input client. |
| 70 bool IsTextInputTypeNone() const; | 71 bool IsTextInputTypeNone() const; |
| 71 | 72 |
| 72 // Convenience method to call the focused text input client's | 73 // Convenience method to call the focused text input client's |
| 73 // OnInputMethodChanged() method. It'll only take effect if the current text | 74 // OnInputMethodChanged() method. It'll only take effect if the current text |
| 74 // input type is not TEXT_INPUT_TYPE_NONE. | 75 // input type is not TEXT_INPUT_TYPE_NONE. |
| 75 void OnInputMethodChanged() const; | 76 void OnInputMethodChanged() const; |
| 76 | 77 |
| 77 // Convenience method to call delegate_->DispatchKeyEventPostIME(). | 78 // Convenience method to call delegate_->DispatchKeyEventPostIME(). |
| 78 // Returns true if the event was processed | 79 // Returns true if the event was processed |
| 79 bool DispatchKeyEventPostIME(const ui::KeyEvent& event) const; | 80 ui::EventDispatchDetails DispatchKeyEventPostIME( |
| 81 ui::KeyEvent* event) const; |
| 80 | 82 |
| 81 // Convenience method to notify all observers of TextInputClient changes. | 83 // Convenience method to notify all observers of TextInputClient changes. |
| 82 void NotifyTextInputStateChanged(const TextInputClient* client); | 84 void NotifyTextInputStateChanged(const TextInputClient* client); |
| 83 | 85 |
| 84 // Convenience method to notify all observers of CaretBounds changes on | 86 // Convenience method to notify all observers of CaretBounds changes on |
| 85 // |client| which is the text input client with focus. | 87 // |client| which is the text input client with focus. |
| 86 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client); | 88 void NotifyTextInputCaretBoundsChanged(const TextInputClient* client); |
| 87 | 89 |
| 88 bool system_toplevel_window_focused() const { | 90 bool system_toplevel_window_focused() const { |
| 89 return system_toplevel_window_focused_; | 91 return system_toplevel_window_focused_; |
| 90 } | 92 } |
| 91 | 93 |
| 92 private: | 94 private: |
| 93 void SetFocusedTextInputClientInternal(TextInputClient* client); | 95 void SetFocusedTextInputClientInternal(TextInputClient* client); |
| 94 | 96 |
| 95 internal::InputMethodDelegate* delegate_; | 97 internal::InputMethodDelegate* delegate_; |
| 96 TextInputClient* text_input_client_; | 98 TextInputClient* text_input_client_; |
| 97 | 99 |
| 98 base::ObserverList<InputMethodObserver> observer_list_; | 100 base::ObserverList<InputMethodObserver> observer_list_; |
| 99 | 101 |
| 100 bool system_toplevel_window_focused_; | 102 bool system_toplevel_window_focused_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); | 104 DISALLOW_COPY_AND_ASSIGN(InputMethodBase); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace ui | 107 } // namespace ui |
| 106 | 108 |
| 107 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ | 109 #endif // UI_BASE_IME_INPUT_METHOD_BASE_H_ |
| OLD | NEW |