Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 11606005: Browser Plugin: Simplify BrowserPluginGuestHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser_plugin/browser_plugin.h" 5 #include "content/renderer/browser_plugin/browser_plugin.h"
6 6
7 #include "base/json/json_string_value_serializer.h" 7 #include "base/json/json_string_value_serializer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 void BrowserPlugin::OnShouldAcceptTouchEvents(int instance_id, bool accept) { 431 void BrowserPlugin::OnShouldAcceptTouchEvents(int instance_id, bool accept) {
432 if (container()) { 432 if (container()) {
433 container()->requestTouchEventType(accept ? 433 container()->requestTouchEventType(accept ?
434 WebKit::WebPluginContainer::TouchEventRequestTypeRaw : 434 WebKit::WebPluginContainer::TouchEventRequestTypeRaw :
435 WebKit::WebPluginContainer::TouchEventRequestTypeNone); 435 WebKit::WebPluginContainer::TouchEventRequestTypeNone);
436 } 436 }
437 } 437 }
438 438
439 void BrowserPlugin::OnUpdateRect( 439 void BrowserPlugin::OnUpdateRect(
440 int instance_id, 440 int instance_id,
441 int message_id,
442 const BrowserPluginMsg_UpdateRect_Params& params) { 441 const BrowserPluginMsg_UpdateRect_Params& params) {
443 bool use_new_damage_buffer = !backing_store_; 442 bool use_new_damage_buffer = !backing_store_;
444 BrowserPluginHostMsg_AutoSize_Params auto_size_params; 443 BrowserPluginHostMsg_AutoSize_Params auto_size_params;
445 BrowserPluginHostMsg_ResizeGuest_Params resize_guest_params; 444 BrowserPluginHostMsg_ResizeGuest_Params resize_guest_params;
446 // If we have a pending damage buffer, and the guest has begun to use the 445 // If we have a pending damage buffer, and the guest has begun to use the
447 // damage buffer then we know the guest will no longer use the current 446 // damage buffer then we know the guest will no longer use the current
448 // damage buffer. At this point, we drop the current damage buffer, and 447 // damage buffer. At this point, we drop the current damage buffer, and
449 // mark the pending damage buffer as the current damage buffer. 448 // mark the pending damage buffer as the current damage buffer.
450 if (DamageBufferMatches(pending_damage_buffer_, 449 if (DamageBufferMatches(pending_damage_buffer_,
451 params.damage_buffer_identifier)) { 450 params.damage_buffer_identifier)) {
(...skipping 17 matching lines...) Expand all
469 // If we have no pending damage buffer, then the guest has not caught up 468 // If we have no pending damage buffer, then the guest has not caught up
470 // with the BrowserPlugin container. We now tell the guest about the new 469 // with the BrowserPlugin container. We now tell the guest about the new
471 // container size. 470 // container size.
472 pending_damage_buffer_ = 471 pending_damage_buffer_ =
473 GetDamageBufferWithSizeParams(&auto_size_params, 472 GetDamageBufferWithSizeParams(&auto_size_params,
474 &resize_guest_params); 473 &resize_guest_params);
475 } 474 }
476 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( 475 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
477 render_view_routing_id_, 476 render_view_routing_id_,
478 instance_id_, 477 instance_id_,
479 message_id,
480 auto_size_params, 478 auto_size_params,
481 resize_guest_params)); 479 resize_guest_params));
482 return; 480 return;
483 } 481 }
484 482
485 if (auto_size_ && (params.view_size != last_view_size_)) { 483 if (auto_size_ && (params.view_size != last_view_size_)) {
486 if (backing_store_) 484 if (backing_store_)
487 backing_store_->Clear(SK_ColorWHITE); 485 backing_store_->Clear(SK_ColorWHITE);
488 gfx::Size old_view_size = last_view_size_; 486 gfx::Size old_view_size = last_view_size_;
489 last_view_size_ = params.view_size; 487 last_view_size_ = params.view_size;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 535 }
538 // Invalidate the container. 536 // Invalidate the container.
539 // If the BrowserPlugin is scheduled to be deleted, then container_ will be 537 // If the BrowserPlugin is scheduled to be deleted, then container_ will be
540 // NULL so we shouldn't attempt to access it. 538 // NULL so we shouldn't attempt to access it.
541 if (container_) 539 if (container_)
542 container_->invalidate(); 540 container_->invalidate();
543 PopulateAutoSizeParameters(&auto_size_params); 541 PopulateAutoSizeParameters(&auto_size_params);
544 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( 542 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
545 render_view_routing_id_, 543 render_view_routing_id_,
546 instance_id_, 544 instance_id_,
547 message_id,
548 auto_size_params, 545 auto_size_params,
549 resize_guest_params)); 546 resize_guest_params));
550 } 547 }
551 548
552 void BrowserPlugin::SetMaxHeightAttribute(int max_height) { 549 void BrowserPlugin::SetMaxHeightAttribute(int max_height) {
553 if (max_height_ == max_height) 550 if (max_height_ == max_height)
554 return; 551 return;
555 max_height_ = max_height; 552 max_height_ = max_height;
556 if (!auto_size_) 553 if (!auto_size_)
557 return; 554 return;
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 void* notify_data) { 1083 void* notify_data) {
1087 } 1084 }
1088 1085
1089 void BrowserPlugin::didFailLoadingFrameRequest( 1086 void BrowserPlugin::didFailLoadingFrameRequest(
1090 const WebKit::WebURL& url, 1087 const WebKit::WebURL& url,
1091 void* notify_data, 1088 void* notify_data,
1092 const WebKit::WebURLError& error) { 1089 const WebKit::WebURLError& error) {
1093 } 1090 }
1094 1091
1095 } // namespace content 1092 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.h ('k') | content/renderer/browser_plugin/browser_plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698