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 "webkit/glue/plugins/webplugin_delegate_impl.h" | 5 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 bool WebPluginDelegateImpl::WindowedCreatePlugin() { | 115 bool WebPluginDelegateImpl::WindowedCreatePlugin() { |
116 DCHECK(!windowed_handle_); | 116 DCHECK(!windowed_handle_); |
117 DCHECK(!plug_); | 117 DCHECK(!plug_); |
118 | 118 |
119 // NPP_GetValue() will write 4 bytes of data to this variable. Don't use a | 119 // NPP_GetValue() will write 4 bytes of data to this variable. Don't use a |
120 // single byte bool, use an int instead. | 120 // single byte bool, use an int instead. |
121 int xembed; | 121 int xembed; |
122 NPError err = instance_->NPP_GetValue(NPPVpluginNeedsXEmbed, &xembed); | 122 NPError err = instance_->NPP_GetValue(NPPVpluginNeedsXEmbed, &xembed); |
123 DCHECK(err == NPERR_NO_ERROR); | 123 if (err != NPERR_NO_ERROR || !xembed) { |
124 if (!xembed) { | 124 NOTIMPLEMENTED() << " windowed plugin but without xembed."; |
125 NOTIMPLEMENTED() << "Windowed plugin but without xembed."; | |
126 return false; | 125 return false; |
127 } | 126 } |
128 | 127 |
129 // Passing 0 as the socket XID creates a plug without plugging it in a socket | 128 // Passing 0 as the socket XID creates a plug without plugging it in a socket |
130 // yet, so that it can be latter added with gtk_socket_add_id(). | 129 // yet, so that it can be latter added with gtk_socket_add_id(). |
131 plug_ = gtk_plug_new(0); | 130 plug_ = gtk_plug_new(0); |
132 gtk_widget_show(plug_); | 131 gtk_widget_show(plug_); |
133 socket_ = gtk_socket_new(); | 132 socket_ = gtk_socket_new(); |
134 gtk_widget_show(socket_); | 133 gtk_widget_show(socket_); |
135 gtk_container_add(GTK_CONTAINER(plug_), socket_); | 134 gtk_container_add(GTK_CONTAINER(plug_), socket_); |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 if (event->event == WM_MOUSEMOVE) { | 699 if (event->event == WM_MOUSEMOVE) { |
701 // Snag a reference to the current cursor ASAP in case the plugin modified | 700 // Snag a reference to the current cursor ASAP in case the plugin modified |
702 // it. There is a nasty race condition here with the multiprocess browser | 701 // it. There is a nasty race condition here with the multiprocess browser |
703 // as someone might be setting the cursor in the main process as well. | 702 // as someone might be setting the cursor in the main process as well. |
704 *cursor = current_windowless_cursor_; | 703 *cursor = current_windowless_cursor_; |
705 } | 704 } |
706 #endif | 705 #endif |
707 | 706 |
708 return ret; | 707 return ret; |
709 } | 708 } |
OLD | NEW |