summaryrefslogtreecommitdiffstats
path: root/lib/web_contents_view_qt.cpp
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2013-07-02 17:03:53 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2013-07-02 18:16:11 +0200
commit42dd83708062f493a1f0e4508fbb36d5c1f0b59a (patch)
tree82fafd9ec2e97d50f1d94d2b354f3ed7f14e1720 /lib/web_contents_view_qt.cpp
parentbbf3de053792cf042a6086b28f48e1aaee395657 (diff)
Implement focus handling functions
Add setKeyboardFocus and hasKeyboardFocus members to the render widget host view delegates and use them for focus handling. Change-Id: Id117298bccc5fdbbb940869e64d925f3708e808c Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'lib/web_contents_view_qt.cpp')
-rw-r--r--lib/web_contents_view_qt.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp
index ef099c1e6..1ac83ca47 100644
--- a/lib/web_contents_view_qt.cpp
+++ b/lib/web_contents_view_qt.cpp
@@ -43,6 +43,7 @@
#include "browser_context_qt.h"
#include "content_browser_client_qt.h"
+#include "render_widget_host_view_qt_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
@@ -57,8 +58,8 @@ WebContentsViewQtClient::WebContentsViewQtClient()
content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host)
{
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
- RenderWidgetHostViewQtDelegate *viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(view);
- view->SetDelegate(viewDelegate);
+ m_viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(view);
+ view->SetDelegate(m_viewDelegate);
return view;
}
@@ -75,3 +76,13 @@ void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const
if (rwhv)
*out = rwhv->GetViewBounds();
}
+
+void WebContentsViewQt::Focus()
+{
+ m_viewDelegate->setKeyboardFocus();
+}
+
+void WebContentsViewQt::SetInitialFocus()
+{
+ Focus();
+}