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

Unified Diff: views/widget/native_widget_views.cc

Issue 7748013: More input focus fix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_views.cc
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index 6e0139be0a786698fc0e0310fa2edf66111636d6..c029b2f922108e976cd03e29bc06c6e71ef59177 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -69,11 +69,13 @@ void NativeWidgetViews::OnActivate(bool active) {
if (widget->is_top_level()) {
InputMethod* input_method = widget->GetInputMethodDirect();
if (active) {
- input_method->OnFocus();
+ if (input_method)
+ input_method->OnFocus();
// See description of got_initial_focus_in_ for details on this.
widget->GetFocusManager()->RestoreFocusedView();
} else {
- input_method->OnBlur();
+ if (input_method)
+ input_method->OnBlur();
widget->GetFocusManager()->StoreFocusedView();
}
}
@@ -81,7 +83,7 @@ void NativeWidgetViews::OnActivate(bool active) {
}
bool NativeWidgetViews::OnKeyEvent(const KeyEvent& key_event) {
- InputMethod* input_method = GetWidget()->GetInputMethodDirect();
+ InputMethod* input_method = GetWidget()->GetInputMethod();
DCHECK(input_method);
input_method->DispatchKeyEvent(key_event);
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698