summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-30 16:58:06 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-30 17:03:09 +0100
commit32ea33253afbbdefd2680aa95ab5f57455272ae7 (patch)
tree2389569585b666c310fbb36d3fb8e6ab94462967 /Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp
parent41c25f231cbca1babc445187283524cc6c751c71 (diff)
downloadqtwebkit-32ea33253afbbdefd2680aa95ab5f57455272ae7.tar.gz
Imported WebKit commit 6a4a1d32e1d779548c726c4826cba9d69eb87601 (http://svn.webkit.org/repository/webkit/trunk@136242)
Final import for the Qt 5.x series that implements the QtWebKit / QtWebKitWidgets split Extra fixes will be cherry-picked. Change-Id: I844f1ebb99c6d6b75db31d6538c2acd628e79681 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp
index ef2da1c98..13efe8c68 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp
@@ -23,15 +23,40 @@
#include "AuthenticationChallengeProxy.h"
#include "AuthenticationDecisionListener.h"
#include "WebCredential.h"
+#include "WebKitWebViewBasePrivate.h"
+#include "WebKitWebViewPrivate.h"
+#include <gtk/gtk.h>
namespace WebKit {
+// This is necessary because GtkEventBox does not draw a background by default,
+// but we want it to have a normal GtkWindow background.
+static gboolean drawSignal(GtkWidget* widget, cairo_t* cr, GtkStyleContext* styleContext)
+{
+ gtk_render_background(styleContext, cr, 0, 0,
+ gtk_widget_get_allocated_width(widget), gtk_widget_get_allocated_height(widget));
+ return FALSE;
+}
+
WebKit2GtkAuthenticationDialog::WebKit2GtkAuthenticationDialog(AuthenticationChallengeProxy* authenticationChallenge)
- : GtkAuthenticationDialog(0, authenticationChallenge->core())
+ : GtkAuthenticationDialog(authenticationChallenge->core())
, m_authenticationChallenge(authenticationChallenge)
+ , m_styleContext(adoptGRef(gtk_style_context_new()))
{
- // We aren't passing a toplevel to the GtkAuthenticationDialog constructor,
- // because eventually this widget will be embedded into the WebView itself.
+ m_dialog = gtk_event_box_new();
+
+ GtkWidget* frame = gtk_frame_new(0);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+ gtk_container_add(GTK_CONTAINER(m_dialog), frame);
+ createContentsInContainer(frame);
+
+ gtk_style_context_add_class(m_styleContext.get(), GTK_STYLE_CLASS_BACKGROUND);
+ GtkWidgetPath* path = gtk_widget_path_new();
+ gtk_widget_path_append_type(path, GTK_TYPE_WINDOW);
+ gtk_style_context_set_path(m_styleContext.get(), path);
+ gtk_widget_path_free(path);
+
+ g_signal_connect(m_dialog, "draw", G_CALLBACK(drawSignal), m_styleContext.get());
}
void WebKit2GtkAuthenticationDialog::authenticate(const WebCore::Credential& credential)