| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_GTK_PLUGIN_CONTAINER_MANAGER_H_ |
| 6 #define WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_GTK_PLUGIN_CONTAINER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "webkit/plugins/webkit_plugins_export.h" | |
| 13 | 12 |
| 14 typedef struct _GtkWidget GtkWidget; | 13 typedef struct _GtkWidget GtkWidget; |
| 15 | 14 |
| 16 namespace webkit { | 15 namespace content { |
| 17 namespace npapi { | |
| 18 | |
| 19 struct WebPluginGeometry; | 16 struct WebPluginGeometry; |
| 20 | 17 |
| 21 // Helper class that creates and manages plugin containers (GtkSocket). | 18 // Helper class that creates and manages plugin containers (GtkSocket). |
| 22 class WEBKIT_PLUGINS_EXPORT GtkPluginContainerManager { | 19 class GtkPluginContainerManager { |
| 23 public: | 20 public: |
| 24 GtkPluginContainerManager(); | 21 GtkPluginContainerManager(); |
| 25 ~GtkPluginContainerManager(); | 22 ~GtkPluginContainerManager(); |
| 26 | 23 |
| 27 // Sets the widget that will host the plugin containers. Must be a GtkFixed. | 24 // Sets the widget that will host the plugin containers. Must be a GtkFixed. |
| 28 void set_host_widget(GtkWidget *widget) { host_widget_ = widget; } | 25 void set_host_widget(GtkWidget *widget) { host_widget_ = widget; } |
| 29 | 26 |
| 30 // Creates a new plugin container, for a given plugin XID. | 27 // Creates a new plugin container, for a given plugin XID. |
| 31 GtkWidget* CreatePluginContainer(gfx::PluginWindowHandle id); | 28 GtkWidget* CreatePluginContainer(gfx::PluginWindowHandle id); |
| 32 | 29 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 49 static void RealizeCallback(GtkWidget *widget, void *user_data); | 46 static void RealizeCallback(GtkWidget *widget, void *user_data); |
| 50 | 47 |
| 51 // Parent of the plugin containers. | 48 // Parent of the plugin containers. |
| 52 GtkWidget* host_widget_; | 49 GtkWidget* host_widget_; |
| 53 | 50 |
| 54 // A map that associates plugin containers to the plugin XID. | 51 // A map that associates plugin containers to the plugin XID. |
| 55 typedef std::map<gfx::PluginWindowHandle, GtkWidget*> PluginWindowToWidgetMap; | 52 typedef std::map<gfx::PluginWindowHandle, GtkWidget*> PluginWindowToWidgetMap; |
| 56 PluginWindowToWidgetMap plugin_window_to_widget_map_; | 53 PluginWindowToWidgetMap plugin_window_to_widget_map_; |
| 57 }; | 54 }; |
| 58 | 55 |
| 59 } // namespace npapi | 56 } // namespace content |
| 60 } // namespace webkit | |
| 61 | 57 |
| 62 #endif // WEBKIT_PLUGINS_NPAPI_GTK_PLUGIN_CONTAINER_MANAGER_H_ | 58 #endif // CONTENT_BROWSER_RENDERER_HOST_GTK_PLUGIN_CONTAINER_MANAGER_H_ |
| OLD | NEW |