OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "content/browser/renderer_host/gtk_plugin_container.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
11 namespace webkit { | 11 namespace content { |
12 namespace npapi { | |
13 | 12 |
14 namespace { | 13 namespace { |
15 | 14 |
16 // NOTE: This class doesn't have constructors/destructors, it is created | 15 // NOTE: This class doesn't have constructors/destructors, it is created |
17 // through GLib's object management. | 16 // through GLib's object management. |
18 class GtkPluginContainer : public GtkSocket { | 17 class GtkPluginContainer : public GtkSocket { |
19 public: | 18 public: |
20 // Sets the requested size of the widget. | 19 // Sets the requested size of the widget. |
21 void set_size(int width, int height) { | 20 void set_size(int width, int height) { |
22 width_ = width; | 21 width_ = width; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 GtkWidget* gtk_plugin_container_new() { | 79 GtkWidget* gtk_plugin_container_new() { |
81 return GTK_WIDGET(g_object_new(GtkPluginContainer::GetType(), NULL)); | 80 return GTK_WIDGET(g_object_new(GtkPluginContainer::GetType(), NULL)); |
82 } | 81 } |
83 | 82 |
84 void gtk_plugin_container_set_size(GtkWidget *widget, int width, int height) { | 83 void gtk_plugin_container_set_size(GtkWidget *widget, int width, int height) { |
85 GtkPluginContainer::CastChecked(widget)->set_size(width, height); | 84 GtkPluginContainer::CastChecked(widget)->set_size(width, height); |
86 // Signal the parent that the size request has changed. | 85 // Signal the parent that the size request has changed. |
87 gtk_widget_queue_resize_no_redraw(widget); | 86 gtk_widget_queue_resize_no_redraw(widget); |
88 } | 87 } |
89 | 88 |
90 } // namespace npapi | 89 } // namespace content |
91 } // namespace webkit | |
OLD | NEW |