summaryrefslogtreecommitdiffstats
path: root/views/ime/input_method_base.cc
diff options
context:
space:
mode:
authorpenghuang@chromium.org <penghuang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-12 12:45:27 +0000
committerpenghuang@chromium.org <penghuang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-12 12:45:27 +0000
commit566e824bc5d3daf32519795629d73146b36991f0 (patch)
tree0acb5eaabec4292bc562ca9de8ac9c8c09805212 /views/ime/input_method_base.cc
parenta90c3b6b4b9197494293c15439065c43a27a3469 (diff)
downloadchromium_src-566e824bc5d3daf32519795629d73146b36991f0.zip
chromium_src-566e824bc5d3daf32519795629d73146b36991f0.tar.gz
chromium_src-566e824bc5d3daf32519795629d73146b36991f0.tar.bz2
Use input method to control visibility of virtual keyboard.
BUG=None TEST=Test in Chrome OS and Linux desktop Review URL: http://codereview.chromium.org/7217008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/ime/input_method_base.cc')
-rw-r--r--views/ime/input_method_base.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/views/ime/input_method_base.cc b/views/ime/input_method_base.cc
index 5716f46..89753fb 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/text_input_type_tracker.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;
+ TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
+ GetTextInputType(), widget_);
}
void InputMethodBase::OnBlur() {
widget_focused_ = false;
+ TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
+ GetTextInputType(), widget_);
+}
+
+void InputMethodBase::OnTextInputTypeChanged(View* view) {
+ if (IsViewFocused(view)) {
+ TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
+ GetTextInputType(), widget_);
+ }
}
TextInputClient* InputMethodBase::GetTextInputClient() const {
@@ -68,6 +80,11 @@ void InputMethodBase::FocusWillChange(View* focused_before, View* focused) {
FocusedViewWillChange();
focused_view_ = focused;
FocusedViewDidChange();
+
+ if (widget_focused_) {
+ TextInputTypeTracker::GetInstance()->OnTextInputTypeChanged(
+ GetTextInputType(), widget_);
+ }
}
bool InputMethodBase::IsViewFocused(View* view) const {