| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/plugins/npapi/gtk_plugin_container_manager.h" | 5 #include "webkit/glue/plugins/gtk_plugin_container_manager.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "gfx/gtk_util.h" | 10 #include "gfx/gtk_util.h" |
| 11 #include "webkit/plugins/npapi/gtk_plugin_container.h" | 11 #include "webkit/glue/plugins/gtk_plugin_container.h" |
| 12 #include "webkit/plugins/npapi/webplugin.h" | 12 #include "webkit/glue/plugins/webplugin.h" |
| 13 | |
| 14 namespace webkit { | |
| 15 namespace npapi { | |
| 16 | 13 |
| 17 GtkPluginContainerManager::GtkPluginContainerManager() : host_widget_(NULL) {} | 14 GtkPluginContainerManager::GtkPluginContainerManager() : host_widget_(NULL) {} |
| 18 | 15 |
| 19 GtkPluginContainerManager::~GtkPluginContainerManager() {} | 16 GtkPluginContainerManager::~GtkPluginContainerManager() {} |
| 20 | 17 |
| 21 GtkWidget* GtkPluginContainerManager::CreatePluginContainer( | 18 GtkWidget* GtkPluginContainerManager::CreatePluginContainer( |
| 22 gfx::PluginWindowHandle id) { | 19 gfx::PluginWindowHandle id) { |
| 23 DCHECK(host_widget_); | 20 DCHECK(host_widget_); |
| 24 GtkWidget *widget = gtk_plugin_container_new(); | 21 GtkWidget *widget = gtk_plugin_container_new(); |
| 25 plugin_window_to_widget_map_.insert(std::make_pair(id, widget)); | 22 plugin_window_to_widget_map_.insert(std::make_pair(id, widget)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 gfx::PluginWindowHandle id) { | 49 gfx::PluginWindowHandle id) { |
| 53 DCHECK(host_widget_); | 50 DCHECK(host_widget_); |
| 54 GtkWidget* widget = MapIDToWidget(id); | 51 GtkWidget* widget = MapIDToWidget(id); |
| 55 if (widget) | 52 if (widget) |
| 56 gtk_widget_destroy(widget); | 53 gtk_widget_destroy(widget); |
| 57 | 54 |
| 58 plugin_window_to_widget_map_.erase(id); | 55 plugin_window_to_widget_map_.erase(id); |
| 59 } | 56 } |
| 60 | 57 |
| 61 void GtkPluginContainerManager::MovePluginContainer( | 58 void GtkPluginContainerManager::MovePluginContainer( |
| 62 const WebPluginGeometry& move) { | 59 const webkit_glue::WebPluginGeometry& move) { |
| 63 DCHECK(host_widget_); | 60 DCHECK(host_widget_); |
| 64 GtkWidget *widget = MapIDToWidget(move.window); | 61 GtkWidget *widget = MapIDToWidget(move.window); |
| 65 if (!widget) | 62 if (!widget) |
| 66 return; | 63 return; |
| 67 | 64 |
| 68 DCHECK(!GTK_WIDGET_NO_WINDOW(widget)); | 65 DCHECK(!GTK_WIDGET_NO_WINDOW(widget)); |
| 69 | 66 |
| 70 if (!move.visible) { | 67 if (!move.visible) { |
| 71 gtk_widget_hide(widget); | 68 gtk_widget_hide(widget); |
| 72 return; | 69 return; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // static | 146 // static |
| 150 void GtkPluginContainerManager::RealizeCallback(GtkWidget* widget, | 147 void GtkPluginContainerManager::RealizeCallback(GtkWidget* widget, |
| 151 void* user_data) { | 148 void* user_data) { |
| 152 GtkPluginContainerManager* plugin_container_manager = | 149 GtkPluginContainerManager* plugin_container_manager = |
| 153 static_cast<GtkPluginContainerManager*>(user_data); | 150 static_cast<GtkPluginContainerManager*>(user_data); |
| 154 | 151 |
| 155 gfx::PluginWindowHandle id = plugin_container_manager->MapWidgetToID(widget); | 152 gfx::PluginWindowHandle id = plugin_container_manager->MapWidgetToID(widget); |
| 156 if (id) | 153 if (id) |
| 157 gtk_socket_add_id(GTK_SOCKET(widget), id); | 154 gtk_socket_add_id(GTK_SOCKET(widget), id); |
| 158 } | 155 } |
| 159 | |
| 160 } // namespace npapi | |
| 161 } // namespace webkit | |
| OLD | NEW |