| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 DCHECK(!windowed_handle_); | 256 DCHECK(!windowed_handle_); |
| 257 | 257 |
| 258 bool xembed; | 258 bool xembed; |
| 259 NPError err = instance_->NPP_GetValue(NPPVpluginNeedsXEmbed, &xembed); | 259 NPError err = instance_->NPP_GetValue(NPPVpluginNeedsXEmbed, &xembed); |
| 260 DCHECK(err == NPERR_NO_ERROR); | 260 DCHECK(err == NPERR_NO_ERROR); |
| 261 if (!xembed) { | 261 if (!xembed) { |
| 262 NOTIMPLEMENTED() << "Windowed plugin but without xembed."; | 262 NOTIMPLEMENTED() << "Windowed plugin but without xembed."; |
| 263 return false; | 263 return false; |
| 264 } | 264 } |
| 265 | 265 |
| 266 window_.window = reinterpret_cast<void*>(parent_); | 266 // Xembed plugins need a window created for them browser-side. |
| 267 // The remainder of the code expects windowed_handle_ to exist for | 267 // Do that now. |
| 268 // windowed mode, despite not actually ever reaching through | 268 windowed_handle_ = plugin_->CreatePluginContainer(); |
| 269 // windowed_handle_. It is still used as a token to represent "this | 269 window_.window = reinterpret_cast<void*>(windowed_handle_); |
| 270 // plugin" in messages to the browser. | |
| 271 windowed_handle_ = parent_; | |
| 272 | 270 |
| 273 if (!window_.ws_info) | 271 if (!window_.ws_info) |
| 274 window_.ws_info = new NPSetWindowCallbackStruct; | 272 window_.ws_info = new NPSetWindowCallbackStruct; |
| 275 NPSetWindowCallbackStruct* extra = | 273 NPSetWindowCallbackStruct* extra = |
| 276 static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); | 274 static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); |
| 277 extra->display = GDK_DISPLAY(); | 275 extra->display = GDK_DISPLAY(); |
| 278 extra->visual = DefaultVisual(GDK_DISPLAY(), 0); | 276 extra->visual = DefaultVisual(GDK_DISPLAY(), 0); |
| 279 extra->depth = DefaultDepth(GDK_DISPLAY(), 0); | 277 extra->depth = DefaultDepth(GDK_DISPLAY(), 0); |
| 280 extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); | 278 extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); |
| 281 | 279 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 return stream; | 840 return stream; |
| 843 } | 841 } |
| 844 | 842 |
| 845 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, | 843 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, |
| 846 bool notify_needed, | 844 bool notify_needed, |
| 847 intptr_t notify_data) { | 845 intptr_t notify_data) { |
| 848 if (notify_needed) { | 846 if (notify_needed) { |
| 849 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); | 847 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); |
| 850 } | 848 } |
| 851 } | 849 } |
| OLD | NEW |