diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index c687041..abd10fa 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -868,8 +868,13 @@ void ConstrainedWindowImpl::ActivateConstrainedWindow() { // better find whether the inner window should get focus. ::SetFocus(constrained_contents_->GetContainerHWND()); } else { - // Give our window the focus so we get keyboard messages. - ::SetFocus(GetHWND()); + views::View* view_to_focus = NULL; + if (window_delegate()) + view_to_focus = window_delegate()->GetInitiallyFocusedView(); + if (view_to_focus) + view_to_focus->RequestFocus(); + else // Give our window the focus so we get keyboard messages. + ::SetFocus(GetHWND()); } } } |