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

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

Issue 147251: linux: cleanup browser-side GtkSockets when plugins are destroyed (Closed)
Patch Set: fixed Created 11 years, 5 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> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 23 matching lines...) Expand all
34 34
35 #if defined(OS_LINUX) 35 #if defined(OS_LINUX)
36 // Create a new plugin parent container, returning its X window id for 36 // Create a new plugin parent container, returning its X window id for
37 // embedders to use. 37 // embedders to use.
38 GdkNativeWindow CreatePluginContainer(); 38 GdkNativeWindow CreatePluginContainer();
39 39
40 // Map a GdkNativeWindow returned by CreatePluginContainer() back to 40 // Map a GdkNativeWindow returned by CreatePluginContainer() back to
41 // the GtkWidget hosting it. Used when we get a message back from the 41 // the GtkWidget hosting it. Used when we get a message back from the
42 // renderer indicating a plugin needs to move. 42 // renderer indicating a plugin needs to move.
43 GtkWidget* MapIDToWidget(GdkNativeWindow id); 43 GtkWidget* MapIDToWidget(GdkNativeWindow id);
44
45 // Called when a plugin has been destroyed. Lets us clean up our side.
46 void OnPluginWindowDestroyed(GdkNativeWindow id);
44 #endif 47 #endif
45 48
46 protected: 49 protected:
47 #if defined(OS_WIN) 50 #if defined(OS_WIN)
48 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) { 51 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) {
49 return false; 52 return false;
50 } 53 }
51 #endif 54 #endif
52 55
53 #if defined(OS_LINUX) 56 #if defined(OS_LINUX)
54 // A map used for MapIDToWidget() above. 57 // A map used for MapIDToWidget() above.
55 typedef std::map<GdkNativeWindow, GtkWidget*> NativeWindowToWidgetMap; 58 typedef std::map<GdkNativeWindow, GtkWidget*> NativeWindowToWidgetMap;
56 NativeWindowToWidgetMap native_window_to_widget_map_; 59 NativeWindowToWidgetMap native_window_to_widget_map_;
57 60
58 // Callback for when one of our plugins goes away. 61 // Callback for when one of our plugins goes away.
59 static gboolean OnPlugRemovedThunk(GtkSocket* socket, 62 static gboolean OnPlugRemovedThunk(GtkSocket* socket,
60 WebViewHost* web_view_host) { 63 WebViewHost* web_view_host) {
61 return web_view_host->OnPlugRemoved(socket); 64 return web_view_host->OnPlugRemoved(socket);
62 } 65 }
63 gboolean OnPlugRemoved(GtkSocket* socket); 66 gboolean OnPlugRemoved(GtkSocket* socket);
64 #endif 67 #endif
65 }; 68 };
66 69
67 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H_ 70 #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