summaryrefslogtreecommitdiffstats
path: root/patches/0001-Temporary-patch-add-some-Qt-member-functions-to-Rend.patch
blob: 8ab997e135d9c018b778d05036678b9fad2b5944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
From 30b08c80f4b17fada28703f2e15c98207875e771 Mon Sep 17 00:00:00 2001
From: Zeno Albisser <zeno@webkit.org>
Date: Tue, 14 May 2013 10:52:58 +0200
Subject: [PATCH] Temporary patch: add some Qt member functions to
 RenderWidgetHostView.

This patch should be removed again, once we manage to avoid the use of
GetNativeView() or we manage to make gfx::NativeView a QWindow.w
---
 content/browser/renderer_host/render_widget_host_view_gtk.h | 1 +
 content/browser/web_contents/web_contents_view_gtk.cc       | 7 +++++++
 content/browser/web_contents/web_contents_view_gtk.h        | 1 +
 content/content_shell.gypi                                  | 1 -
 content/public/browser/render_widget_host_view.h            | 3 +++
 content/public/browser/web_contents_view.h                  | 2 ++
 content/shell/shell.cc                                      | 1 +
 content/shell/shell.h                                       | 2 ++
 8 files changed, 17 insertions(+), 1 deletion(-)

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 46daaac..271ad19 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.h
@@ -55,6 +55,7 @@ class CONTENT_EXPORT RenderWidgetHostViewGtk
   virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
   virtual void SetSize(const gfx::Size& size) OVERRIDE;
   virtual void SetBounds(const gfx::Rect& rect) OVERRIDE;
+  virtual gfx::NativeView GetNativeViewGTK() const { return gfx::NativeView(); };
   virtual gfx::NativeView GetNativeView() const OVERRIDE;
   virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
   virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc
index 9cb9212..8202258 100644
--- a/content/browser/web_contents/web_contents_view_gtk.cc
+++ b/content/browser/web_contents/web_contents_view_gtk.cc
@@ -115,6 +115,13 @@ gfx::NativeView WebContentsViewGtk::GetNativeView() const {
   return expanded_.get();
 }
 
+QWindow* WebContentsViewGtk::GetNativeViewQt() const {
+  RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
+  if (!rwhv)
+    return NULL;
+  return rwhv->GetNativeViewQt();
+}
+
 gfx::NativeView WebContentsViewGtk::GetContentNativeView() const {
   RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
   if (!rwhv)
diff --git a/content/browser/web_contents/web_contents_view_gtk.h b/content/browser/web_contents/web_contents_view_gtk.h
index a5a15a2..f4a5a93 100644
--- a/content/browser/web_contents/web_contents_view_gtk.h
+++ b/content/browser/web_contents/web_contents_view_gtk.h
@@ -46,6 +46,7 @@ class CONTENT_EXPORT WebContentsViewGtk
   // WebContentsView implementation --------------------------------------------
 
   virtual gfx::NativeView GetNativeView() const OVERRIDE;
+  virtual QWindow* GetNativeViewQt() const OVERRIDE;
   virtual gfx::NativeView GetContentNativeView() const OVERRIDE;
   virtual gfx::NativeWindow GetTopLevelNativeWindow() const OVERRIDE;
   virtual void GetContainerBounds(gfx::Rect* out) const OVERRIDE;
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 1bf233b..fc6bf96 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -82,7 +82,6 @@
         'shell/shell.h',
         'shell/shell_android.cc',
         'shell/shell_aura.cc',
-        'shell/shell_gtk.cc',
         'shell/shell_mac.mm',
         'shell/shell_win.cc',
         'shell/shell_application_mac.h',
diff --git a/content/public/browser/render_widget_host_view.h b/content/public/browser/render_widget_host_view.h
index b881748..3eccb42 100644
--- a/content/public/browser/render_widget_host_view.h
+++ b/content/public/browser/render_widget_host_view.h
@@ -18,6 +18,7 @@
 #endif
 
 class GURL;
+class QWindow;
 
 namespace gfx {
 class Rect;
@@ -76,7 +77,9 @@ class CONTENT_EXPORT RenderWidgetHostView {
 
   // Retrieves the native view used to contain plugins and identify the
   // renderer in IPC messages.
+  virtual gfx::NativeView GetNativeViewGTK() const { return 0; };
   virtual gfx::NativeView GetNativeView() const = 0;
+  virtual QWindow* GetNativeViewQt() const { return 0; }
   virtual gfx::NativeViewId GetNativeViewId() const = 0;
   virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0;
 
diff --git a/content/public/browser/web_contents_view.h b/content/public/browser/web_contents_view.h
index d0a7309..9cfddb4 100644
--- a/content/public/browser/web_contents_view.h
+++ b/content/public/browser/web_contents_view.h
@@ -15,6 +15,7 @@
 #include "ui/gfx/size.h"
 
 struct WebDropData;
+class QWindow;
 
 namespace content {
 
@@ -27,6 +28,7 @@ class CONTENT_EXPORT WebContentsView {
 
   // Returns the native widget that contains the contents of the tab.
   virtual gfx::NativeView GetNativeView() const = 0;
+  virtual QWindow* GetNativeViewQt() const { return 0; }
 
   // Returns the native widget with the main content of the tab (i.e. the main
   // render view host, though there may be many popups in the tab as children of
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index 5eac7af..3e4bd60 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -46,6 +46,7 @@ Shell::Shell(WebContents* web_contents)
     : devtools_frontend_(NULL),
       is_fullscreen_(false),
       window_(NULL),
+      m_window(NULL),
       url_edit_view_(NULL),
 #if defined(OS_WIN) && !defined(USE_AURA)
       default_edit_wnd_proc_(0),
diff --git a/content/shell/shell.h b/content/shell/shell.h
index 736bd3f..4d028cf 100644
--- a/content/shell/shell.h
+++ b/content/shell/shell.h
@@ -37,6 +37,7 @@ class ViewsDelegate;
 }
 #endif
 
+class QWidget;
 class GURL;
 namespace content {
 
@@ -219,6 +220,7 @@ class Shell : public WebContentsDelegate,
   bool is_fullscreen_;
 
   gfx::NativeWindow window_;
+  QWidget* m_window;
   gfx::NativeEditView url_edit_view_;
 
   // Notification manager
-- 
1.8.1.2