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

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: Rebase 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
« no previous file with comments | « views/ime/input_method_base.h ('k') | views/ime/input_method_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..89753fb45072b2d02b5416e93370a8a236d4e5cd 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 {
« no previous file with comments | « views/ime/input_method_base.h ('k') | views/ime/input_method_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698