summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-02 14:57:50 +0000
committerSteve Block <steveblock@google.com>2010-02-04 15:06:55 +0000
commitd0825bca7fe65beaee391d30da42e937db621564 (patch)
tree7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
parent3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff)
downloadexternal_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip
external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz
external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp')
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp37
1 files changed, 13 insertions, 24 deletions
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index d9a043b..8ea8991 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -64,7 +64,11 @@ void ChromeClient::chromeDestroyed()
FloatRect ChromeClient::windowRect()
{
GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (gtk_widget_is_toplevel(window)) {
+#else
if (GTK_WIDGET_TOPLEVEL(window)) {
+#endif
gint left, top, width, height;
gtk_window_get_position(GTK_WINDOW(window), &left, &top);
gtk_window_get_size(GTK_WINDOW(window), &width, &height);
@@ -106,7 +110,11 @@ void ChromeClient::focus()
void ChromeClient::unfocus()
{
GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (gtk_widget_is_toplevel(window))
+#else
if (GTK_WIDGET_TOPLEVEL(window))
+#endif
gtk_window_set_focus(GTK_WINDOW(window), NULL);
}
@@ -234,7 +242,11 @@ void ChromeClient::closeWindowSoon()
bool ChromeClient::canTakeFocus(FocusDirection)
{
+#if GTK_CHECK_VERSION(2, 18, 0)
+ return gtk_widget_get_can_focus(GTK_WIDGET(m_webView));
+#else
return GTK_WIDGET_CAN_FOCUS(m_webView);
+#endif
}
void ChromeClient::takeFocus(FocusDirection)
@@ -442,20 +454,6 @@ void ChromeClient::scrollbarsModeDidChange() const
void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned modifierFlags)
{
- // If a tooltip must be displayed it will be, afterwards, when
- // setToolTip is called; this is just a work-around to make sure
- // it updates its location correctly; see
- // https://bugs.webkit.org/show_bug.cgi?id=15793.
- g_object_set(m_webView, "has-tooltip", FALSE, NULL);
-
- GdkDisplay* gdkDisplay;
- GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
- if (GTK_WIDGET_TOPLEVEL(window))
- gdkDisplay = gtk_widget_get_display(window);
- else
- gdkDisplay = gdk_display_get_default();
- gtk_tooltip_trigger_tooltip_query(gdkDisplay);
-
// check if the element is a link...
bool isLink = hit.isLiveLink();
if (isLink) {
@@ -475,16 +473,7 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned mo
void ChromeClient::setToolTip(const String& toolTip, TextDirection)
{
-#if GTK_CHECK_VERSION(2,12,0)
- if (toolTip.isEmpty())
- g_object_set(m_webView, "has-tooltip", FALSE, NULL);
- else
- gtk_widget_set_tooltip_text(GTK_WIDGET(m_webView), toolTip.utf8().data());
-#else
- // TODO: Support older GTK+ versions
- // See http://bugs.webkit.org/show_bug.cgi?id=15793
- notImplemented();
-#endif
+ webkit_web_view_set_tooltip_text(m_webView, toolTip.utf8().data());
}
void ChromeClient::print(Frame* frame)