Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: webkit/tools/test_shell/webview_host.h

Issue 146009: linux plugins: eliminate GtkWidget* from plugin process (Closed)
Patch Set: retry Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_
6 #define WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ 6 #define WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_
7 7
8 #include <map>
9
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/gfx/native_widget_types.h" 11 #include "base/gfx/native_widget_types.h"
10 #include "base/gfx/rect.h" 12 #include "base/gfx/rect.h"
11 #include "webkit/tools/test_shell/webwidget_host.h" 13 #include "webkit/tools/test_shell/webwidget_host.h"
12 14
13 struct WebPreferences; 15 struct WebPreferences;
14 class WebView; 16 class WebView;
15 class WebViewDelegate; 17 class WebViewDelegate;
16 18
19 #if defined(OS_LINUX)
20 typedef struct _GtkSocket GtkSocket;
21 #endif
22
17 // This class is a simple NativeView-based host for a WebView 23 // This class is a simple NativeView-based host for a WebView
18 class WebViewHost : public WebWidgetHost { 24 class WebViewHost : public WebWidgetHost {
19 public: 25 public:
20 // The new instance is deleted once the associated NativeView is destroyed. 26 // The new instance is deleted once the associated NativeView is destroyed.
21 // The newly created window should be resized after it is created, using the 27 // The newly created window should be resized after it is created, using the
22 // MoveWindow (or equivalent) function. 28 // MoveWindow (or equivalent) function.
23 static WebViewHost* Create(gfx::NativeView parent_view, 29 static WebViewHost* Create(gfx::NativeView parent_view,
24 WebViewDelegate* delegate, 30 WebViewDelegate* delegate,
25 const WebPreferences& prefs); 31 const WebPreferences& prefs);
26 32
27 WebView* webview() const; 33 WebView* webview() const;
28 34
35 #if defined(OS_LINUX)
36 // Create a new plugin parent container, returning its X window id for
37 // embedders to use.
38 GdkNativeWindow CreatePluginContainer();
39
40 // Map a GdkNativeWindow returned by CreatePluginContainer() back to
41 // the GtkWidget hosting it. Used when we get a message back from the
42 // renderer indicating a plugin needs to move.
43 GtkWidget* MapIDToWidget(GdkNativeWindow id);
44 #endif
45
29 protected: 46 protected:
30 #if defined(OS_WIN) 47 #if defined(OS_WIN)
31 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) { 48 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) {
32 return false; 49 return false;
33 } 50 }
34 #endif 51 #endif
52
53 #if defined(OS_LINUX)
54 // A map used for MapIDToWidget() above.
55 typedef std::map<GdkNativeWindow, GtkWidget*> NativeWindowToWidgetMap;
56 NativeWindowToWidgetMap native_window_to_widget_map_;
57
58 // Callback for when one of our plugins goes away.
59 static gboolean OnPlugRemovedThunk(GtkSocket* socket,
60 WebViewHost* web_view_host) {
61 return web_view_host->OnPlugRemoved(socket);
62 }
63 gboolean OnPlugRemoved(GtkSocket* socket);
64 #endif
35 }; 65 };
36 66
37 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ 67 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate_gtk.cc ('k') | webkit/tools/test_shell/webview_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698