| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 void WebPluginDelegateImpl::WindowedSetWindow() { | 309 void WebPluginDelegateImpl::WindowedSetWindow() { |
| 310 if (!instance_) | 310 if (!instance_) |
| 311 return; | 311 return; |
| 312 | 312 |
| 313 if (!windowed_handle_) { | 313 if (!windowed_handle_) { |
| 314 NOTREACHED(); | 314 NOTREACHED(); |
| 315 return; | 315 return; |
| 316 } | 316 } |
| 317 | 317 |
| 318 // See https://bugzilla.mozilla.org/show_bug.cgi?id=108347 |
| 319 // If we call NPP_SetWindow with a <= 0 width or height, problems arise in |
| 320 // Flash (and possibly other plugins). |
| 321 // TODO(piman): the Mozilla code suggests that for the Java plugin, we should |
| 322 // still call NPP_SetWindow in that case. We need to verify that. |
| 323 if (window_rect_.width() <= 0 || window_rect_.height() <= 0) { |
| 324 return; |
| 325 } |
| 326 |
| 318 instance()->set_window_handle(windowed_handle_); | 327 instance()->set_window_handle(windowed_handle_); |
| 319 | 328 |
| 320 DCHECK(!instance()->windowless()); | 329 DCHECK(!instance()->windowless()); |
| 321 | 330 |
| 322 window_.clipRect.top = clip_rect_.y(); | 331 window_.clipRect.top = clip_rect_.y(); |
| 323 window_.clipRect.left = clip_rect_.x(); | 332 window_.clipRect.left = clip_rect_.x(); |
| 324 window_.clipRect.bottom = clip_rect_.y() + clip_rect_.height(); | 333 window_.clipRect.bottom = clip_rect_.y() + clip_rect_.height(); |
| 325 window_.clipRect.right = clip_rect_.x() + clip_rect_.width(); | 334 window_.clipRect.right = clip_rect_.x() + clip_rect_.width(); |
| 326 window_.height = window_rect_.height(); | 335 window_.height = window_rect_.height(); |
| 327 window_.width = window_rect_.width(); | 336 window_.width = window_rect_.width(); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 return stream; | 853 return stream; |
| 845 } | 854 } |
| 846 | 855 |
| 847 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, | 856 void WebPluginDelegateImpl::URLRequestRouted(const std::string&url, |
| 848 bool notify_needed, | 857 bool notify_needed, |
| 849 intptr_t notify_data) { | 858 intptr_t notify_data) { |
| 850 if (notify_needed) { | 859 if (notify_needed) { |
| 851 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); | 860 instance()->SetURLLoadData(GURL(url.c_str()), notify_data); |
| 852 } | 861 } |
| 853 } | 862 } |
| OLD | NEW |