summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc17
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h11
2 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 403480b..f0ec3a5 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -39,6 +39,10 @@
#include "third_party/WebKit/WebKit/chromium/public/gtk/WebInputEventFactory.h"
#include "webkit/glue/webcursor_gtk_data.h"
+#if defined(OS_CHROMEOS)
+#include "views/widget/tooltip_window_gtk.h"
+#endif // defined(OS_CHROMEOS)
+
static const int kMaxWindowWidth = 4000;
static const int kMaxWindowHeight = 4000;
@@ -349,6 +353,11 @@ void RenderWidgetHostViewGtk::InitAsChild() {
// |key_bindings_handler_| must be created after creating |view_| widget.
key_bindings_handler_.reset(new GtkKeyBindingsHandler(view_.get()));
plugin_container_manager_.set_host_widget(view_.get());
+
+#if defined(OS_CHROMEOS)
+ tooltip_window_.reset(new views::TooltipWindowGtk(view_.get()));
+#endif // defined(OS_CHROMEOS)
+
gtk_widget_show(view_.get());
}
@@ -363,6 +372,11 @@ void RenderWidgetHostViewGtk::InitAsPopup(
// |key_bindings_handler_| must be created after creating |view_| widget.
key_bindings_handler_.reset(new GtkKeyBindingsHandler(view_.get()));
plugin_container_manager_.set_host_widget(view_.get());
+
+#if defined(OS_CHROMEOS)
+ tooltip_window_.reset(new views::TooltipWindowGtk(view_.get()));
+#endif // defined(OS_CHROMEOS)
+
gtk_container_add(GTK_CONTAINER(popup), view_.get());
// If we are not activatable, we don't want to grab keyboard input,
@@ -608,6 +622,9 @@ void RenderWidgetHostViewGtk::SetTooltipText(const std::wstring& tooltip_text) {
} else {
gtk_widget_set_tooltip_text(view_.get(),
WideToUTF8(clamped_tooltip).c_str());
+#if defined(OS_CHROMEOS)
+ tooltip_window_->SetTooltipText(clamped_tooltip);
+#endif // defined(OS_CHROMEOS)
}
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index e5939b5..3f9d90d 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -26,6 +26,12 @@ class GtkKeyBindingsHandler;
class MenuGtk;
struct NativeWebKeyboardEvent;
+#if defined(OS_CHROMEOS)
+namespace views {
+class TooltipWindowGtk;
+}
+#endif // defined(OS_CHROMEOS)
+
typedef struct _GtkClipboard GtkClipboard;
typedef struct _GtkSelectionData GtkSelectionData;
@@ -179,6 +185,11 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView {
// The size that we want the renderer to be. We keep this in a separate
// variable because resizing in GTK+ is async.
gfx::Size requested_size_;
+
+#if defined(OS_CHROMEOS)
+ // Custimized tooltip window.
+ scoped_ptr<views::TooltipWindowGtk> tooltip_window_;
+#endif // defined(OS_CHROMEOS)
};
#endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_