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

Unified Diff: ui/base/ime/input_method_base.h

Issue 80583002: [FYI] All-in-one OnCandidateWindow{Show,Update,Hide} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698