diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-08-08 13:56:38 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-12 12:04:53 +0200 |
commit | 80ead68ca80bca4f33e824064bff5af3b939a803 (patch) | |
tree | 200257aa555eced28a29d9d7a3e6078f8e3dbef3 /lib/web_contents_view_qt.cpp | |
parent | 08bfd6fb1595f4940316845348b5a262f55e7077 (diff) |
Avoid keeping a RWHVDelegate pointer in WebContentsViewQt.
There can be multiple RWHVDelegates within one WebContentsViewQt
during navigation. Avoid keeping a pointer by sending the focus
call to the client directly, which fits the purpose better.
Change-Id: I863c174e9a2567f3580f3cb525bc5353ab2a4417
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/web_contents_view_qt.cpp')
-rw-r--r-- | lib/web_contents_view_qt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp index 9d35b622f..7903d24fe 100644 --- a/lib/web_contents_view_qt.cpp +++ b/lib/web_contents_view_qt.cpp @@ -50,9 +50,9 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host) { RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); - m_viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(); - m_viewDelegate->resetView(view); - view->SetDelegate(m_viewDelegate); + RenderWidgetHostViewQtDelegate* viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(); + viewDelegate->resetView(view); + view->SetDelegate(viewDelegate); return view; } @@ -71,7 +71,7 @@ void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const void WebContentsViewQt::Focus() { - m_viewDelegate->setKeyboardFocus(); + m_client->focusContainer(); } void WebContentsViewQt::SetInitialFocus() |