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 "webkit/plugins/npapi/webplugin_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // We invalidate windowed plugins during the first geometry update to | 340 // We invalidate windowed plugins during the first geometry update to |
341 // ensure that they get reparented to the wrapper window in the browser. | 341 // ensure that they get reparented to the wrapper window in the browser. |
342 // This ensures that they become visible and are painted by the OS. This is | 342 // This ensures that they become visible and are painted by the OS. This is |
343 // required as some pages don't invalidate when the plugin is added. | 343 // required as some pages don't invalidate when the plugin is added. |
344 if (first_geometry_update_ && window_) { | 344 if (first_geometry_update_ && window_) { |
345 InvalidateRect(window_rect); | 345 InvalidateRect(window_rect); |
346 } | 346 } |
347 } | 347 } |
348 | 348 |
349 // Only UpdateGeometry if either the window or clip rects have changed. | 349 // Only UpdateGeometry if either the window or clip rects have changed. |
350 if (first_geometry_update_ || | 350 if (delegate_ && (first_geometry_update_ || |
351 new_geometry.window_rect != geometry_.window_rect || | 351 new_geometry.window_rect != geometry_.window_rect || |
352 new_geometry.clip_rect != geometry_.clip_rect) { | 352 new_geometry.clip_rect != geometry_.clip_rect)) { |
353 // Notify the plugin that its parameters have changed. | 353 // Notify the plugin that its parameters have changed. |
354 delegate_->UpdateGeometry(new_geometry.window_rect, new_geometry.clip_rect); | 354 delegate_->UpdateGeometry(new_geometry.window_rect, new_geometry.clip_rect); |
355 } | 355 } |
356 | 356 |
357 // Initiate a download on the plugin url. This should be done for the | 357 // Initiate a download on the plugin url. This should be done for the |
358 // first update geometry sequence. We need to ensure that the plugin | 358 // first update geometry sequence. We need to ensure that the plugin |
359 // receives the geometry update before it starts receiving data. | 359 // receives the geometry update before it starts receiving data. |
360 if (first_geometry_update_) { | 360 if (first_geometry_update_) { |
361 // An empty url corresponds to an EMBED tag with no src attribute. | 361 // An empty url corresponds to an EMBED tag with no src attribute. |
362 if (!load_manually_ && plugin_url_.is_valid()) { | 362 if (!load_manually_ && plugin_url_.is_valid()) { |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 webframe_->setReferrerForRequest(*request, plugin_url_); | 1435 webframe_->setReferrerForRequest(*request, plugin_url_); |
1436 break; | 1436 break; |
1437 | 1437 |
1438 default: | 1438 default: |
1439 break; | 1439 break; |
1440 } | 1440 } |
1441 } | 1441 } |
1442 | 1442 |
1443 } // namespace npapi | 1443 } // namespace npapi |
1444 } // namespace webkit | 1444 } // namespace webkit |
OLD | NEW |