| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Xembed plugins need a window created for them browser-side. | 266 // Xembed plugins need a window created for them browser-side. |
| 267 // Do that now. | 267 // Do that now. |
| 268 windowed_handle_ = plugin_->CreatePluginContainer(); | 268 windowed_handle_ = plugin_->CreatePluginContainer(); |
| 269 if (!windowed_handle_) |
| 270 return false; |
| 271 |
| 269 window_.window = reinterpret_cast<void*>(windowed_handle_); | 272 window_.window = reinterpret_cast<void*>(windowed_handle_); |
| 270 | 273 |
| 271 if (!window_.ws_info) | 274 if (!window_.ws_info) |
| 272 window_.ws_info = new NPSetWindowCallbackStruct; | 275 window_.ws_info = new NPSetWindowCallbackStruct; |
| 273 NPSetWindowCallbackStruct* extra = | 276 NPSetWindowCallbackStruct* extra = |
| 274 static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); | 277 static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); |
| 275 extra->display = GDK_DISPLAY(); | 278 extra->display = GDK_DISPLAY(); |
| 276 extra->visual = DefaultVisual(GDK_DISPLAY(), 0); | 279 extra->visual = DefaultVisual(GDK_DISPLAY(), 0); |
| 277 extra->depth = DefaultDepth(GDK_DISPLAY(), 0); | 280 extra->depth = DefaultDepth(GDK_DISPLAY(), 0); |
| 278 extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); | 281 extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 return stream; | 843 return stream; |
| 841 } | 844 } |
| 842 | 845 |
| 843 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, | 846 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, |
| 844 bool notify_needed, | 847 bool notify_needed, |
| 845 intptr_t notify_data) { | 848 intptr_t notify_data) { |
| 846 if (notify_needed) { | 849 if (notify_needed) { |
| 847 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); | 850 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); |
| 848 } | 851 } |
| 849 } | 852 } |
| OLD | NEW |