summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 10:38:44 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 10:38:44 +0000
commit5d95a899e78e5eb6ad4d2b93079a17a5ee8a45e4 (patch)
tree0ca063562b12f4285d4b61f6f0bece31226ef50e /content
parent7190356cd82b2bb25e850a5acf231a2e60ab0189 (diff)
downloadchromium_src-5d95a899e78e5eb6ad4d2b93079a17a5ee8a45e4.zip
chromium_src-5d95a899e78e5eb6ad4d2b93079a17a5ee8a45e4.tar.gz
chromium_src-5d95a899e78e5eb6ad4d2b93079a17a5ee8a45e4.tar.bz2
Remove last render_widget_host_view_gtk.h dependency in Chrome
by adding to base interface. TBR=ben@chromium.org BUG=98716 Review URL: http://codereview.chromium.org/9307032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/render_widget_host_view.h12
-rw-r--r--content/browser/renderer_host/render_widget_host_view_gtk.cc6
-rw-r--r--content/browser/renderer_host/render_widget_host_view_gtk.h14
-rw-r--r--content/browser/renderer_host/test_render_view_host.cc13
-rw-r--r--content/browser/renderer_host/test_render_view_host.h6
-rw-r--r--content/browser/tab_contents/tab_contents_view_gtk.cc4
6 files changed, 40 insertions, 15 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view.h b/content/browser/renderer_host/render_widget_host_view.h
index 2dd3982..85144bc 100644
--- a/content/browser/renderer_host/render_widget_host_view.h
+++ b/content/browser/renderer_host/render_widget_host_view.h
@@ -10,6 +10,10 @@
#include <OpenGL/OpenGL.h>
#endif
+#if defined(TOOLKIT_USES_GTK)
+#include <gdk/gdk.h>
+#endif
+
#include <string>
#include <vector>
@@ -296,7 +300,13 @@ class RenderWidgetHostView {
#if defined(TOOLKIT_USES_GTK)
virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0;
virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0;
-#endif
+ // Gets the event for the last mouse down.
+ virtual GdkEventButton* GetLastMouseDown() = 0;
+#if !defined(TOOLKIT_VIEWS)
+ // Builds a submenu containing all the gtk input method commands.
+ virtual gfx::NativeView BuildInputMethodsGtkMenu() = 0;
+#endif // !defined(TOOLKIT_VIEWS)
+#endif // defined(TOOLKIT_USES_GTK)
#if defined(OS_WIN) && !defined(USE_AURA)
virtual void WillWmDestroy() = 0;
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index 4bd5731..5614fd4 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -932,8 +932,12 @@ void RenderWidgetHostViewGtk::SelectionBoundsChanged(
im_context_->UpdateCaretBounds(start_rect.Union(end_rect));
}
+GdkEventButton* RenderWidgetHostViewGtk::GetLastMouseDown() {
+ return last_mouse_down_;
+}
+
#if !defined(TOOLKIT_VIEWS)
-GtkWidget* RenderWidgetHostViewGtk::BuildInputMethodsGtkMenu() {
+gfx::NativeView RenderWidgetHostViewGtk::BuildInputMethodsGtkMenu() {
return im_context_->BuildInputMethodsGtkMenu();
}
#endif
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/content/browser/renderer_host/render_widget_host_view_gtk.h
index 5a253fe..c709483 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.h
@@ -101,6 +101,11 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView {
virtual void SetBackground(const SkBitmap& background) OVERRIDE;
virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE;
virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE;
+ virtual GdkEventButton* GetLastMouseDown() OVERRIDE;
+#if !defined(TOOLKIT_VIEWS)
+ // Builds a submenu containing all the gtk input method commands.
+ virtual gfx::NativeView BuildInputMethodsGtkMenu() OVERRIDE;
+#endif
virtual void UnhandledWheelEvent(
const WebKit::WebMouseWheelEvent& event) OVERRIDE;
virtual void ProcessTouchAck(bool processed) OVERRIDE;
@@ -137,15 +142,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk : public RenderWidgetHostView {
bool RetrieveSurrounding(std::string* text, size_t* cursor_index);
- GdkEventButton* last_mouse_down() const {
- return last_mouse_down_;
- }
-
-#if !defined(TOOLKIT_VIEWS)
- // Builds a submenu containing all the gtk input method commands.
- GtkWidget* BuildInputMethodsGtkMenu();
-#endif
-
protected:
friend class RenderWidgetHostView;
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index fcc374d..7cabedf 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -1,4 +1,3 @@
-
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -284,6 +283,18 @@ gfx::Rect TestRenderWidgetHostView::GetRootWindowBounds() {
}
#endif
+#if defined(TOOLKIT_USES_GTK)
+GdkEventButton* TestRenderWidgetHostView::GetLastMouseDown() {
+ return NULL;
+}
+
+#if !defined(TOOLKIT_VIEWS)
+gfx::NativeView TestRenderWidgetHostView::BuildInputMethodsGtkMenu() {
+ return NULL;
+}
+#endif // !defined(TOOLKIT_VIEWS)
+#endif // defined(TOOLKIT_USES_GTK)
+
gfx::GLSurfaceHandle TestRenderWidgetHostView::GetCompositingSurface() {
return gfx::GLSurfaceHandle();
}
diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h
index c85fd03..b3276e7 100644
--- a/content/browser/renderer_host/test_render_view_host.h
+++ b/content/browser/renderer_host/test_render_view_host.h
@@ -152,7 +152,11 @@ class TestRenderWidgetHostView : public RenderWidgetHostView {
#if defined(TOOLKIT_USES_GTK)
virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE { }
virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE { }
-#endif
+ virtual GdkEventButton* GetLastMouseDown() OVERRIDE;
+#if !defined(TOOLKIT_VIEWS)
+ virtual gfx::NativeView BuildInputMethodsGtkMenu() OVERRIDE;
+#endif // !defined(TOOLKIT_VIEWS)
+#endif // defined(TOOLKIT_USES_GTK)
virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
diff --git a/content/browser/tab_contents/tab_contents_view_gtk.cc b/content/browser/tab_contents/tab_contents_view_gtk.cc
index 1c0480b..f4a46d5 100644
--- a/content/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/content/browser/tab_contents/tab_contents_view_gtk.cc
@@ -411,10 +411,10 @@ void TabContentsViewGtk::StartDragging(const WebDropData& drop_data,
RenderWidgetHostViewGtk* view_gtk = static_cast<RenderWidgetHostViewGtk*>(
tab_contents_->GetRenderWidgetHostView());
- if (!view_gtk || !view_gtk->last_mouse_down())
+ if (!view_gtk || !view_gtk->GetLastMouseDown())
return;
- drag_source_->StartDragging(drop_data, ops, view_gtk->last_mouse_down(),
+ drag_source_->StartDragging(drop_data, ops, view_gtk->GetLastMouseDown(),
image, image_offset);
}