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