summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2013-06-26 20:07:56 +0200
committerAndras Becsi <andras.becsi@digia.com>2013-06-27 17:43:22 +0200
commitb2a20d9c65b35b33634f290cea2c038ed1801a6f (patch)
tree3d2f7c21c5563e279031e2fec6473a9963ea3226
parent3b26bdea37cf1be0e3411ba6d8097e7a8fb600d1 (diff)
Implement WebContentsViewQt::GetContainerBounds
This is based on other ports' implementations and seems to be used for sizing / positioning popup menus. Change-Id: I96fa89529157a774571f252d751879b7e61119d0 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
-rw-r--r--lib/web_contents_view_qt.cpp9
-rw-r--r--lib/web_contents_view_qt.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp
index 51af43d5e..ef099c1e6 100644
--- a/lib/web_contents_view_qt.cpp
+++ b/lib/web_contents_view_qt.cpp
@@ -44,6 +44,8 @@
#include "browser_context_qt.h"
#include "content_browser_client_qt.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
+
WebContentsViewQtClient::WebContentsViewQtClient()
// This has to be the first thing we do.
: context(WebEngineContext::current())
@@ -66,3 +68,10 @@ void WebContentsViewQt::SetPageTitle(const string16& title)
QString string = QString::fromUtf16(title.data());
Q_EMIT m_client->webContentsDelegate->titleChanged(string);
}
+
+void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const
+{
+ content::RenderWidgetHostView* rwhv = m_client->webContentsDelegate->web_contents()->GetRenderWidgetHostView();
+ if (rwhv)
+ *out = rwhv->GetViewBounds();
+}
diff --git a/lib/web_contents_view_qt.h b/lib/web_contents_view_qt.h
index 5f59d4934..d55674ac7 100644
--- a/lib/web_contents_view_qt.h
+++ b/lib/web_contents_view_qt.h
@@ -93,7 +93,7 @@ public:
virtual gfx::NativeWindow GetTopLevelNativeWindow() const { QT_NOT_YET_IMPLEMENTED return 0; }
- virtual void GetContainerBounds(gfx::Rect* out) const { QT_NOT_YET_IMPLEMENTED }
+ virtual void GetContainerBounds(gfx::Rect* out) const;
virtual void OnTabCrashed(base::TerminationStatus status, int error_code) { QT_NOT_YET_IMPLEMENTED }