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

Side by Side Diff: views/widget/native_widget_views.cc

Issue 7744029: Possible fix for the issue that keyboard doesn't show up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git-try Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/native_widget_views.h" 5 #include "views/widget/native_widget_views.h"
6 6
7 #include "ui/gfx/compositor/compositor.h" 7 #include "ui/gfx/compositor/compositor.h"
8 #include "views/desktop/desktop_window_view.h" 8 #include "views/desktop/desktop_window_view.h"
9 #include "views/view.h" 9 #include "views/view.h"
10 #include "views/views_delegate.h" 10 #include "views/views_delegate.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // TODO(oshima): find out if we should check toplevel here. 60 // TODO(oshima): find out if we should check toplevel here.
61 if (active_ == active) 61 if (active_ == active)
62 return; 62 return;
63 active_ = active; 63 active_ = active;
64 delegate_->OnNativeWidgetActivationChanged(active); 64 delegate_->OnNativeWidgetActivationChanged(active);
65 65
66 // TODO(oshima): Focus change should be separated from window activation. 66 // TODO(oshima): Focus change should be separated from window activation.
67 // This will be fixed when we have WM API. 67 // This will be fixed when we have WM API.
68 Widget* widget = GetWidget(); 68 Widget* widget = GetWidget();
69 if (widget->is_top_level()) { 69 if (widget->is_top_level()) {
70 InputMethod* input_method = widget->GetInputMethodDirect(); 70 InputMethod* input_method = widget->GetInputMethod();
71 if (active) { 71 if (active) {
72 if (input_method) 72 input_method->OnFocus();
73 input_method->OnFocus();
74 // See description of got_initial_focus_in_ for details on this. 73 // See description of got_initial_focus_in_ for details on this.
75 widget->GetFocusManager()->RestoreFocusedView(); 74 widget->GetFocusManager()->RestoreFocusedView();
76 } else { 75 } else {
77 if (input_method) 76 input_method->OnBlur();
78 input_method->OnBlur();
79 widget->GetFocusManager()->StoreFocusedView(); 77 widget->GetFocusManager()->StoreFocusedView();
80 } 78 }
81 } 79 }
82 view_->SchedulePaint(); 80 view_->SchedulePaint();
83 } 81 }
84 82
85 bool NativeWidgetViews::OnKeyEvent(const KeyEvent& key_event) { 83 bool NativeWidgetViews::OnKeyEvent(const KeyEvent& key_event) {
86 InputMethod* input_method = GetWidget()->GetInputMethod(); 84 InputMethod* input_method = GetWidget()->GetInputMethod();
87 DCHECK(input_method); 85 DCHECK(input_method);
88 input_method->DispatchKeyEvent(key_event); 86 input_method->DispatchKeyEvent(key_event);
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 508
511 const internal::NativeWidgetPrivate* 509 const internal::NativeWidgetPrivate*
512 NativeWidgetViews::GetParentNativeWidget() const { 510 NativeWidgetViews::GetParentNativeWidget() const {
513 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL; 511 const Widget* containing_widget = view_ ? view_->GetWidget() : NULL;
514 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>( 512 return containing_widget ? static_cast<const internal::NativeWidgetPrivate*>(
515 containing_widget->native_widget()) : 513 containing_widget->native_widget()) :
516 NULL; 514 NULL;
517 } 515 }
518 516
519 } // namespace views 517 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/native_widget_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698