Index: ui/views/controls/webview/webview.cc |
=================================================================== |
--- ui/views/controls/webview/webview.cc (revision 133496) |
+++ ui/views/controls/webview/webview.cc (working copy) |
@@ -180,6 +180,13 @@ |
if (web_contents_) { |
wcv_holder_->Attach(web_contents_->GetNativeView()); |
+ // The WebContentsView will not be focused automatically when it is |
+ // attached, so we need to pass on focus to it if the FocusManager thinks |
+ // the WebView is focused. Note that not every Widget has a focus manager. |
+ FocusManager* focus_manager = GetFocusManager(); |
+ if (focus_manager && focus_manager->GetFocusedView() == this) |
+ web_contents_->Focus(); |
+ |
registrar_.Add( |
this, |
content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |