Index: ui/base/ime/input_method_base.h |
diff --git a/ui/base/ime/input_method_base.h b/ui/base/ime/input_method_base.h |
index 1920decd07f2b3da578ec054a99d9dfdc2dccec2..10ac88dcef4c680fb7f8c1beb2ef29c41bcb413b 100644 |
--- a/ui/base/ime/input_method_base.h |
+++ b/ui/base/ime/input_method_base.h |
@@ -7,6 +7,7 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/observer_list.h" |
#include "ui/base/ime/input_method.h" |
#include "ui/base/ui_export.h" |
@@ -23,7 +24,9 @@ class TextInputClient; |
// A helper class providing functionalities shared among ui::InputMethod |
// implementations. |
-class UI_EXPORT InputMethodBase : NON_EXPORTED_BASE(public InputMethod) { |
+class UI_EXPORT InputMethodBase |
+ : NON_EXPORTED_BASE(public InputMethod), |
+ public base::SupportsWeakPtr<InputMethodBase> { |
public: |
InputMethodBase(); |
virtual ~InputMethodBase(); |
@@ -77,6 +80,14 @@ class UI_EXPORT InputMethodBase : NON_EXPORTED_BASE(public InputMethod) { |
// Convenience method to notify all observers of TextInputClient changes. |
void NotifyTextInputStateChanged(const TextInputClient* client); |
+ // Interface for for signalling candidate window events. |
+ // See also *Callback functions below. To avoid reentrancy issue that |
+ // TextInputClient manipulates IME state during even handling, these methods |
+ // defer sending actual signals to renderer. |
+ void OnCandidateWindowShown(); |
+ void OnCandidateWindowUpdated(); |
+ void OnCandidateWindowHidden(); |
+ |
bool system_toplevel_window_focused() const { |
return system_toplevel_window_focused_; |
} |
@@ -84,6 +95,12 @@ class UI_EXPORT InputMethodBase : NON_EXPORTED_BASE(public InputMethod) { |
private: |
void SetFocusedTextInputClientInternal(TextInputClient* client); |
+ // Deferred callbacks for signalling TextInputClient about candidate window |
+ // appearance changes. |
+ void CandidateWindowShownCallback(); |
+ void CandidateWindowUpdatedCallback(); |
+ void CandidateWindowHiddenCallback(); |
+ |
internal::InputMethodDelegate* delegate_; |
TextInputClient* text_input_client_; |