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

Unified Diff: views/ime/input_method.h

Issue 7217008: Use input method to control visibility of virtual keyboard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 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 side-by-side diff with in-line comments
Download patch
Index: views/ime/input_method.h
diff --git a/views/ime/input_method.h b/views/ime/input_method.h
index 918d78c031d802ad2fd634138802dcf48b2ac5e7..666bda2b29aebebf881271c3da614c758d70f44e 100644
--- a/views/ime/input_method.h
+++ b/views/ime/input_method.h
@@ -7,6 +7,7 @@
#pragma once
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/i18n/rtl.h"
@@ -23,6 +24,14 @@ class TextInputClient;
class View;
class Widget;
+class TextInputTypeChangedListener {
+ public:
+ virtual void TextInputTypeChanged(View* view, ui::TextInputType type) = 0;
+
+ protected:
+ virtual ~TextInputTypeChangedListener() {}
+};
+
// An interface implemented by an object that encapsulates a native input method
// service provided by the underlying operation system.
// Because on most systems, the system input method service is bound to
@@ -101,6 +110,22 @@ class InputMethod {
// ui::TEXT_INPUT_TYPE_NONE if there is no focused text input client.
virtual ui::TextInputType GetTextInputType() const = 0;
+ // Adds/Removes text input type changed listener
+ void AddTextInputTypeChangedListener(TextInputTypeChangedListener* listener);
+
+ void RemoveTextInputTypeChangedListener(
+ TextInputTypeChangedListener* listener);
+
+ protected:
+ // Notifies all listeners that the text input type is changed.
+ void TextInputTypeChanged(View* view);
+
+ private:
+ // The list of registered TextInputTypeChanged listeners.
+ typedef std::vector<TextInputTypeChangedListener*>
+ TextInputTypeChangedListenerList;
+ TextInputTypeChangedListenerList text_input_type_changed_listeners_;
+
// TODO(suzhe): Support mouse/touch event.
};

Powered by Google App Engine
This is Rietveld 408576698