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

Unified Diff: views/ime/input_method_base.cc

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, 5 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_base.cc
diff --git a/views/ime/input_method_base.cc b/views/ime/input_method_base.cc
index 5716f46a45ed7ad173ad268da6c12ee52ede3bda..e152b023d4b4d7ab43f4e6b2acfd46df810d7ca7 100644
--- a/views/ime/input_method_base.cc
+++ b/views/ime/input_method_base.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "views/ime/input_method_base.h"
+#include "views/ime/input_method_manager.h"
#include "views/view.h"
#include "views/widget/widget.h"
@@ -47,10 +48,21 @@ void InputMethodBase::Init(Widget* widget) {
void InputMethodBase::OnFocus() {
widget_focused_ = true;
+ InputMethodManager *manager = InputMethodManager::GetInstance();
+ manager->OnTextInputTypeChanged(GetTextInputType(), widget_);
James Su 2011/07/07 02:03:03 nit: 1. how about to combine these two lines? The
Peng 2011/07/07 17:56:54 Done.
James Su 2011/07/08 02:15:04 If it's necessary then it's better to state it in
}
void InputMethodBase::OnBlur() {
widget_focused_ = false;
+ InputMethodManager *manager = InputMethodManager::GetInstance();
+ manager->OnTextInputTypeChanged(GetTextInputType(), widget_);
James Su 2011/07/07 02:03:03 ditto
Peng 2011/07/07 17:56:54 Done.
+}
+
+void InputMethodBase::OnTextInputTypeChanged(View* view) {
+ if (IsViewFocused(view)) {
+ InputMethodManager *manager = InputMethodManager::GetInstance();
+ manager->OnTextInputTypeChanged(GetTextInputType(), widget_);
James Su 2011/07/07 02:03:03 ditto
Peng 2011/07/07 17:56:54 Done.
+ }
}
TextInputClient* InputMethodBase::GetTextInputClient() const {
@@ -108,6 +120,10 @@ void InputMethodBase::FocusedViewWillChange() {
}
void InputMethodBase::FocusedViewDidChange() {
+ if (widget_focused_) {
+ InputMethodManager *manager = InputMethodManager::GetInstance();
+ manager->OnTextInputTypeChanged(GetTextInputType(), widget_);
+ }
James Su 2011/07/07 02:03:03 move these code into FocusWillChange(). It may not
Peng 2011/07/07 17:56:54 Done.
}
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698