| OLD | NEW |
| 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 #include <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/webview_host.h" | 7 #include "webkit/tools/test_shell/webview_host.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 NativeWindowToWidgetMap::const_iterator i = | 51 NativeWindowToWidgetMap::const_iterator i = |
| 52 native_window_to_widget_map_.find(id); | 52 native_window_to_widget_map_.find(id); |
| 53 if (i != native_window_to_widget_map_.end()) | 53 if (i != native_window_to_widget_map_.end()) |
| 54 return i->second; | 54 return i->second; |
| 55 | 55 |
| 56 LOG(ERROR) << "Request for widget host for unknown window id " << id; | 56 LOG(ERROR) << "Request for widget host for unknown window id " << id; |
| 57 | 57 |
| 58 return NULL; | 58 return NULL; |
| 59 } | 59 } |
| 60 | 60 |
| 61 gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) { | 61 void WebViewHost::OnPluginWindowDestroyed(GdkNativeWindow id) { |
| 62 // Remove the socket's id from our list of widgets. | 62 GtkWidget* plugin_container = MapIDToWidget(id); |
| 63 GdkNativeWindow id = gtk_socket_get_id(socket); | 63 if (!plugin_container) |
| 64 return; |
| 65 |
| 64 native_window_to_widget_map_.erase(id); | 66 native_window_to_widget_map_.erase(id); |
| 65 | 67 gtk_widget_destroy(plugin_container); |
| 66 return FALSE; // Destroy our widget. | |
| 67 } | 68 } |
| 68 | 69 |
| 70 gboolean WebViewHost::OnPlugRemoved(GtkSocket* socket) { |
| 71 return TRUE; // Don't destroy our widget; we manage it ourselves. |
| 72 } |
| 73 |
| OLD | NEW |