| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 #if defined(OS_WIN) | 305 #if defined(OS_WIN) |
| 306 // Force a geometry update if needed to allow plugins like media player | 306 // Force a geometry update if needed to allow plugins like media player |
| 307 // which defer the initial geometry update to work. | 307 // which defer the initial geometry update to work. |
| 308 container_->reportGeometry(); | 308 container_->reportGeometry(); |
| 309 #endif // OS_WIN | 309 #endif // OS_WIN |
| 310 | 310 |
| 311 // Note that |canvas| is only used when in windowless mode. | 311 // Note that |canvas| is only used when in windowless mode. |
| 312 delegate_->Paint(canvas, paint_rect); | 312 delegate_->Paint(canvas, paint_rect); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void WebPluginImpl::updateGeometry( | 315 void WebPluginImpl::updateGeometry(const WebRect& window_rect, |
| 316 const WebRect& window_rect, const WebRect& clip_rect, | 316 const WebRect& clip_rect, |
| 317 const WebVector<WebRect>& cutout_rects, bool is_visible) { | 317 const WebRect& unobscured_rect, |
| 318 const WebVector<WebRect>& cut_outs_rects, |
| 319 bool is_visible) { |
| 318 WebPluginGeometry new_geometry; | 320 WebPluginGeometry new_geometry; |
| 319 new_geometry.window = window_; | 321 new_geometry.window = window_; |
| 320 new_geometry.window_rect = window_rect; | 322 new_geometry.window_rect = window_rect; |
| 321 new_geometry.clip_rect = clip_rect; | 323 new_geometry.clip_rect = clip_rect; |
| 322 new_geometry.visible = is_visible; | 324 new_geometry.visible = is_visible; |
| 323 new_geometry.rects_valid = true; | 325 new_geometry.rects_valid = true; |
| 324 for (size_t i = 0; i < cutout_rects.size(); ++i) | 326 for (size_t i = 0; i < cut_outs_rects.size(); ++i) |
| 325 new_geometry.cutout_rects.push_back(cutout_rects[i]); | 327 new_geometry.cutout_rects.push_back(cut_outs_rects[i]); |
| 326 | 328 |
| 327 // Only send DidMovePlugin if the geometry changed in some way. | 329 // Only send DidMovePlugin if the geometry changed in some way. |
| 328 if (window_ && (first_geometry_update_ || !new_geometry.Equals(geometry_))) { | 330 if (window_ && (first_geometry_update_ || !new_geometry.Equals(geometry_))) { |
| 329 render_frame_->GetRenderWidget()->SchedulePluginMove(new_geometry); | 331 render_frame_->GetRenderWidget()->SchedulePluginMove(new_geometry); |
| 330 // We invalidate windowed plugins during the first geometry update to | 332 // We invalidate windowed plugins during the first geometry update to |
| 331 // ensure that they get reparented to the wrapper window in the browser. | 333 // ensure that they get reparented to the wrapper window in the browser. |
| 332 // This ensures that they become visible and are painted by the OS. This is | 334 // This ensures that they become visible and are painted by the OS. This is |
| 333 // required as some pages don't invalidate when the plugin is added. | 335 // required as some pages don't invalidate when the plugin is added. |
| 334 if (first_geometry_update_ && window_) { | 336 if (first_geometry_update_ && window_) { |
| 335 InvalidateRect(window_rect); | 337 InvalidateRect(window_rect); |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 case PLUGIN_SRC: | 1532 case PLUGIN_SRC: |
| 1531 webframe_->setReferrerForRequest(*request, plugin_url_); | 1533 webframe_->setReferrerForRequest(*request, plugin_url_); |
| 1532 break; | 1534 break; |
| 1533 | 1535 |
| 1534 default: | 1536 default: |
| 1535 break; | 1537 break; |
| 1536 } | 1538 } |
| 1537 } | 1539 } |
| 1538 | 1540 |
| 1539 } // namespace content | 1541 } // namespace content |
| OLD | NEW |