Index: ui/views/controls/webview/webview.cc |
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc |
index 630ed48558c77e56bcae8244a15500e38ef2aa29..3e07f6f42322810d6eeceb809167c672b579d282 100644 |
--- a/ui/views/controls/webview/webview.cc |
+++ b/ui/views/controls/webview/webview.cc |
@@ -58,6 +58,7 @@ void WebView::SetWebContents(content::WebContents* replacement) { |
DetachWebContents(); |
WebContentsObserver::Observe(replacement); |
// web_contents() now returns |replacement| from here onwards. |
+ SetFocusable(!!web_contents()); |
if (wc_owner_ != replacement) |
wc_owner_.reset(); |
if (embed_fullscreen_widget_mode_enabled_) { |
@@ -198,12 +199,6 @@ bool WebView::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
return web_contents() && !web_contents()->IsCrashed(); |
} |
-bool WebView::IsFocusable() const { |
- // We need to be focusable when our contents is not a view hierarchy, as |
- // clicking on the contents needs to focus us. |
- return !!web_contents(); |
-} |
- |
void WebView::OnFocus() { |
if (web_contents()) |
web_contents()->Focus(); |