summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_shell_gtk.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 02:19:56 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 02:19:56 +0000
commit279c4199ba7327239de927765e74c64a1b8779af (patch)
treec5699e4c6fadccb8555539132473feaf7ba21cfc /webkit/tools/test_shell/test_shell_gtk.cc
parentfc76de1cddd3c1b47fb2e9280c87dafce3010f41 (diff)
downloadchromium_src-279c4199ba7327239de927765e74c64a1b8779af.zip
chromium_src-279c4199ba7327239de927765e74c64a1b8779af.tar.gz
chromium_src-279c4199ba7327239de927765e74c64a1b8779af.tar.bz2
Get popup windows working.
There are still a little funky about redrawing once when they loose focus sadly. Review URL: http://codereview.chromium.org/10720 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5438 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell_gtk.cc')
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index b637f98..fbbc7ff 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -191,8 +191,23 @@ void TestShell::DestroyWindow(gfx::WindowHandle windowHandle) {
}
WebWidget* TestShell::CreatePopupWidget(WebView* webview) {
- NOTIMPLEMENTED();
- return NULL;
+ GtkWidget* popupwindow = gtk_window_new(GTK_WINDOW_POPUP);
+ GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
+ WebWidgetHost* host = WebWidgetHost::Create(vbox, delegate_);
+ gtk_container_add(GTK_CONTAINER(popupwindow), vbox);
+ m_popupHost = host;
+
+ return host->webwidget();
+}
+
+void TestShell::ClosePopup() {
+ DCHECK(m_popupHost);
+ GtkWidget* drawing_area = m_popupHost->window_handle();
+ GtkWidget* window =
+ gtk_widget_get_parent(gtk_widget_get_parent(drawing_area));
+ gtk_widget_destroy(window);
+ m_popupHost->WindowDestroyed();
+ m_popupHost = NULL;
}
void TestShell::ResizeSubViews() {