| 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/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_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 min_height_(0), | 114 min_height_(0), |
| 115 min_width_(0), | 115 min_width_(0), |
| 116 process_id_(-1), | 116 process_id_(-1), |
| 117 persist_storage_(false), | 117 persist_storage_(false), |
| 118 valid_partition_id_(true), | 118 valid_partition_id_(true), |
| 119 content_window_routing_id_(MSG_ROUTING_NONE), | 119 content_window_routing_id_(MSG_ROUTING_NONE), |
| 120 plugin_focused_(false), | 120 plugin_focused_(false), |
| 121 embedder_focused_(false), | 121 embedder_focused_(false), |
| 122 visible_(true), | 122 visible_(true), |
| 123 size_changed_in_flight_(false), | 123 size_changed_in_flight_(false), |
| 124 browser_plugin_manager_(render_view->browser_plugin_manager()), |
| 124 current_nav_entry_index_(0), | 125 current_nav_entry_index_(0), |
| 125 nav_entry_count_(0) { | 126 nav_entry_count_(0) { |
| 126 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); | 127 browser_plugin_manager()->AddBrowserPlugin(instance_id, this); |
| 127 bindings_.reset(new BrowserPluginBindings(this)); | 128 bindings_.reset(new BrowserPluginBindings(this)); |
| 128 | 129 |
| 129 ParseAttributes(params); | 130 ParseAttributes(params); |
| 130 } | 131 } |
| 131 | 132 |
| 132 BrowserPlugin::~BrowserPlugin() { | 133 BrowserPlugin::~BrowserPlugin() { |
| 133 if (damage_buffer_) | 134 if (damage_buffer_) |
| 134 FreeDamageBuffer(); | 135 FreeDamageBuffer(); |
| 135 BrowserPluginManager::Get()->RemoveBrowserPlugin(instance_id_); | 136 browser_plugin_manager()->RemoveBrowserPlugin(instance_id_); |
| 136 BrowserPluginManager::Get()->Send( | 137 browser_plugin_manager()->Send( |
| 137 new BrowserPluginHostMsg_PluginDestroyed( | 138 new BrowserPluginHostMsg_PluginDestroyed( |
| 138 render_view_routing_id_, | 139 render_view_routing_id_, |
| 139 instance_id_)); | 140 instance_id_)); |
| 140 } | 141 } |
| 141 | 142 |
| 142 void BrowserPlugin::Cleanup() { | 143 void BrowserPlugin::Cleanup() { |
| 143 if (damage_buffer_) | 144 if (damage_buffer_) |
| 144 FreeDamageBuffer(); | 145 FreeDamageBuffer(); |
| 145 } | 146 } |
| 146 | 147 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 157 // If we haven't created the guest yet, do so now. We will navigate it right | 158 // If we haven't created the guest yet, do so now. We will navigate it right |
| 158 // after creation. If |src| is empty, we can delay the creation until we | 159 // after creation. If |src| is empty, we can delay the creation until we |
| 159 // acutally need it. | 160 // acutally need it. |
| 160 if (!navigate_src_sent_) { | 161 if (!navigate_src_sent_) { |
| 161 BrowserPluginHostMsg_CreateGuest_Params params; | 162 BrowserPluginHostMsg_CreateGuest_Params params; |
| 162 params.storage_partition_id = storage_partition_id_; | 163 params.storage_partition_id = storage_partition_id_; |
| 163 params.persist_storage = persist_storage_; | 164 params.persist_storage = persist_storage_; |
| 164 params.focused = ShouldGuestBeFocused(); | 165 params.focused = ShouldGuestBeFocused(); |
| 165 params.visible = visible_; | 166 params.visible = visible_; |
| 166 PopulateAutoSizeParameters(¶ms.auto_size); | 167 PopulateAutoSizeParameters(¶ms.auto_size); |
| 167 BrowserPluginManager::Get()->Send( | 168 browser_plugin_manager()->Send( |
| 168 new BrowserPluginHostMsg_CreateGuest( | 169 new BrowserPluginHostMsg_CreateGuest( |
| 169 render_view_routing_id_, | 170 render_view_routing_id_, |
| 170 instance_id_, | 171 instance_id_, |
| 171 params)); | 172 params)); |
| 172 } | 173 } |
| 173 | 174 |
| 174 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> params( | 175 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> params( |
| 175 GetPendingResizeParams()); | 176 GetPendingResizeParams()); |
| 176 DCHECK(!params->resize_pending); | 177 DCHECK(!params->resize_pending); |
| 177 | 178 |
| 178 BrowserPluginManager::Get()->Send( | 179 browser_plugin_manager()->Send( |
| 179 new BrowserPluginHostMsg_NavigateGuest( | 180 new BrowserPluginHostMsg_NavigateGuest( |
| 180 render_view_routing_id_, | 181 render_view_routing_id_, |
| 181 instance_id_, | 182 instance_id_, |
| 182 src, | 183 src, |
| 183 *params)); | 184 *params)); |
| 184 // Record that we sent a NavigateGuest message to embedder. | 185 // Record that we sent a NavigateGuest message to embedder. |
| 185 // Once this instance has navigated, the storage partition cannot be changed, | 186 // Once this instance has navigated, the storage partition cannot be changed, |
| 186 // so this value is used for enforcing this. | 187 // so this value is used for enforcing this. |
| 187 navigate_src_sent_ = true; | 188 navigate_src_sent_ = true; |
| 188 src_ = src; | 189 src_ = src; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 if (!auto_size_params.enable) { | 223 if (!auto_size_params.enable) { |
| 223 view_width = width(); | 224 view_width = width(); |
| 224 view_height = height(); | 225 view_height = height(); |
| 225 } | 226 } |
| 226 TransportDIB* new_damage_buffer = | 227 TransportDIB* new_damage_buffer = |
| 227 PopulateResizeGuestParameters(&resize_params, view_width, view_height); | 228 PopulateResizeGuestParameters(&resize_params, view_width, view_height); |
| 228 // AutoSize initiates a resize so we don't want to issue another resize, | 229 // AutoSize initiates a resize so we don't want to issue another resize, |
| 229 // we just want to make sure the damage buffer has been updated. | 230 // we just want to make sure the damage buffer has been updated. |
| 230 resize_params.resize_pending = true; | 231 resize_params.resize_pending = true; |
| 231 DCHECK(new_damage_buffer); | 232 DCHECK(new_damage_buffer); |
| 232 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetAutoSize( | 233 browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetAutoSize( |
| 233 render_view_routing_id_, | 234 render_view_routing_id_, |
| 234 instance_id_, | 235 instance_id_, |
| 235 auto_size_params, | 236 auto_size_params, |
| 236 resize_params)); | 237 resize_params)); |
| 237 if (damage_buffer_) | 238 if (damage_buffer_) |
| 238 FreeDamageBuffer(); | 239 FreeDamageBuffer(); |
| 239 damage_buffer_ = new_damage_buffer; | 240 damage_buffer_ = new_damage_buffer; |
| 240 } | 241 } |
| 241 | 242 |
| 242 void BrowserPlugin::SizeChangedDueToAutoSize(const gfx::Size& old_view_size) { | 243 void BrowserPlugin::SizeChangedDueToAutoSize(const gfx::Size& old_view_size) { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 WebKit::WebString::fromUTF8(internal_name.c_str()), | 411 WebKit::WebString::fromUTF8(internal_name.c_str()), |
| 411 false, false, | 412 false, false, |
| 412 WebKit::WebSerializedScriptValue::serialize( | 413 WebKit::WebSerializedScriptValue::serialize( |
| 413 v8::String::New(json_string.c_str(), json_string.size()))); | 414 v8::String::New(json_string.c_str(), json_string.size()))); |
| 414 container()->element().dispatchEvent(event); | 415 container()->element().dispatchEvent(event); |
| 415 } | 416 } |
| 416 | 417 |
| 417 void BrowserPlugin::Back() { | 418 void BrowserPlugin::Back() { |
| 418 if (!navigate_src_sent_) | 419 if (!navigate_src_sent_) |
| 419 return; | 420 return; |
| 420 BrowserPluginManager::Get()->Send( | 421 browser_plugin_manager()->Send( |
| 421 new BrowserPluginHostMsg_Go(render_view_routing_id_, | 422 new BrowserPluginHostMsg_Go(render_view_routing_id_, |
| 422 instance_id_, -1)); | 423 instance_id_, -1)); |
| 423 } | 424 } |
| 424 | 425 |
| 425 void BrowserPlugin::Forward() { | 426 void BrowserPlugin::Forward() { |
| 426 if (!navigate_src_sent_) | 427 if (!navigate_src_sent_) |
| 427 return; | 428 return; |
| 428 BrowserPluginManager::Get()->Send( | 429 browser_plugin_manager()->Send( |
| 429 new BrowserPluginHostMsg_Go(render_view_routing_id_, | 430 new BrowserPluginHostMsg_Go(render_view_routing_id_, |
| 430 instance_id_, 1)); | 431 instance_id_, 1)); |
| 431 } | 432 } |
| 432 | 433 |
| 433 void BrowserPlugin::Go(int relative_index) { | 434 void BrowserPlugin::Go(int relative_index) { |
| 434 if (!navigate_src_sent_) | 435 if (!navigate_src_sent_) |
| 435 return; | 436 return; |
| 436 BrowserPluginManager::Get()->Send( | 437 browser_plugin_manager()->Send( |
| 437 new BrowserPluginHostMsg_Go(render_view_routing_id_, | 438 new BrowserPluginHostMsg_Go(render_view_routing_id_, |
| 438 instance_id_, | 439 instance_id_, |
| 439 relative_index)); | 440 relative_index)); |
| 440 } | 441 } |
| 441 | 442 |
| 442 void BrowserPlugin::TerminateGuest() { | 443 void BrowserPlugin::TerminateGuest() { |
| 443 if (!navigate_src_sent_) | 444 if (!navigate_src_sent_) |
| 444 return; | 445 return; |
| 445 BrowserPluginManager::Get()->Send( | 446 browser_plugin_manager()->Send( |
| 446 new BrowserPluginHostMsg_TerminateGuest(render_view_routing_id_, | 447 new BrowserPluginHostMsg_TerminateGuest(render_view_routing_id_, |
| 447 instance_id_)); | 448 instance_id_)); |
| 448 } | 449 } |
| 449 | 450 |
| 450 void BrowserPlugin::Stop() { | 451 void BrowserPlugin::Stop() { |
| 451 if (!navigate_src_sent_) | 452 if (!navigate_src_sent_) |
| 452 return; | 453 return; |
| 453 BrowserPluginManager::Get()->Send( | 454 browser_plugin_manager()->Send( |
| 454 new BrowserPluginHostMsg_Stop(render_view_routing_id_, | 455 new BrowserPluginHostMsg_Stop(render_view_routing_id_, |
| 455 instance_id_)); | 456 instance_id_)); |
| 456 } | 457 } |
| 457 | 458 |
| 458 void BrowserPlugin::Reload() { | 459 void BrowserPlugin::Reload() { |
| 459 if (!navigate_src_sent_) | 460 if (!navigate_src_sent_) |
| 460 return; | 461 return; |
| 461 BrowserPluginManager::Get()->Send( | 462 browser_plugin_manager()->Send( |
| 462 new BrowserPluginHostMsg_Reload(render_view_routing_id_, | 463 new BrowserPluginHostMsg_Reload(render_view_routing_id_, |
| 463 instance_id_)); | 464 instance_id_)); |
| 464 } | 465 } |
| 465 | 466 |
| 466 void BrowserPlugin::SetCursor(const WebCursor& cursor) { | 467 void BrowserPlugin::SetCursor(const WebCursor& cursor) { |
| 467 cursor_ = cursor; | 468 cursor_ = cursor; |
| 468 } | 469 } |
| 469 | 470 |
| 470 void BrowserPlugin::UpdateRect( | 471 void BrowserPlugin::UpdateRect( |
| 471 int message_id, | 472 int message_id, |
| 472 const BrowserPluginMsg_UpdateRect_Params& params) { | 473 const BrowserPluginMsg_UpdateRect_Params& params) { |
| 473 if ((!auto_size_ && | 474 if ((!auto_size_ && |
| 474 (width() != params.view_size.width() || | 475 (width() != params.view_size.width() || |
| 475 height() != params.view_size.height())) || | 476 height() != params.view_size.height())) || |
| 476 (auto_size_ && (!InAutoSizeBounds(params.view_size)))) { | 477 (auto_size_ && (!InAutoSizeBounds(params.view_size)))) { |
| 477 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( | 478 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( |
| 478 render_view_routing_id_, | 479 render_view_routing_id_, |
| 479 instance_id_, | 480 instance_id_, |
| 480 message_id, | 481 message_id, |
| 481 gfx::Size(width(), height()))); | 482 gfx::Size(width(), height()))); |
| 482 return; | 483 return; |
| 483 } | 484 } |
| 484 // If the view size has changed since we last updated. | 485 // If the view size has changed since we last updated. |
| 485 if (auto_size_ && (params.view_size != last_view_size_)) { | 486 if (auto_size_ && (params.view_size != last_view_size_)) { |
| 486 if (backing_store_) | 487 if (backing_store_) |
| 487 backing_store_->Clear(SK_ColorWHITE); | 488 backing_store_->Clear(SK_ColorWHITE); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 for (unsigned i = 0; i < params.copy_rects.size(); i++) { | 531 for (unsigned i = 0; i < params.copy_rects.size(); i++) { |
| 531 backing_store_->PaintToBackingStore(params.bitmap_rect, | 532 backing_store_->PaintToBackingStore(params.bitmap_rect, |
| 532 params.copy_rects, | 533 params.copy_rects, |
| 533 damage_buffer_); | 534 damage_buffer_); |
| 534 } | 535 } |
| 535 // Invalidate the container. | 536 // Invalidate the container. |
| 536 // 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 |
| 537 // NULL so we shouldn't attempt to access it. | 538 // NULL so we shouldn't attempt to access it. |
| 538 if (container_) | 539 if (container_) |
| 539 container_->invalidate(); | 540 container_->invalidate(); |
| 540 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( | 541 browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK( |
| 541 render_view_routing_id_, | 542 render_view_routing_id_, |
| 542 instance_id_, | 543 instance_id_, |
| 543 message_id, | 544 message_id, |
| 544 gfx::Size())); | 545 gfx::Size())); |
| 545 } | 546 } |
| 546 | 547 |
| 547 void BrowserPlugin::GuestGone(int process_id, base::TerminationStatus status) { | 548 void BrowserPlugin::GuestGone(int process_id, base::TerminationStatus status) { |
| 548 // We fire the event listeners before painting the sad graphic to give the | 549 // We fire the event listeners before painting the sad graphic to give the |
| 549 // developer an opportunity to display an alternative overlay image on crash. | 550 // developer an opportunity to display an alternative overlay image on crash. |
| 550 std::string termination_status = TerminationStatusToString(status); | 551 std::string termination_status = TerminationStatusToString(status); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 embedder_focused_ = focused; | 631 embedder_focused_ = focused; |
| 631 | 632 |
| 632 if (ShouldGuestBeFocused() != old_guest_focus_state) | 633 if (ShouldGuestBeFocused() != old_guest_focus_state) |
| 633 UpdateGuestFocus(); | 634 UpdateGuestFocus(); |
| 634 } | 635 } |
| 635 | 636 |
| 636 void BrowserPlugin::UpdateGuestFocus() { | 637 void BrowserPlugin::UpdateGuestFocus() { |
| 637 if (!navigate_src_sent_) | 638 if (!navigate_src_sent_) |
| 638 return; | 639 return; |
| 639 bool should_be_focused = ShouldGuestBeFocused(); | 640 bool should_be_focused = ShouldGuestBeFocused(); |
| 640 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetFocus( | 641 browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetFocus( |
| 641 render_view_routing_id_, | 642 render_view_routing_id_, |
| 642 instance_id_, | 643 instance_id_, |
| 643 should_be_focused)); | 644 should_be_focused)); |
| 644 } | 645 } |
| 645 | 646 |
| 646 bool BrowserPlugin::ShouldGuestBeFocused() const { | 647 bool BrowserPlugin::ShouldGuestBeFocused() const { |
| 647 return plugin_focused_ && embedder_focused_; | 648 return plugin_focused_ && embedder_focused_; |
| 648 } | 649 } |
| 649 | 650 |
| 650 void BrowserPlugin::GuestContentWindowReady(int content_window_routing_id) { | 651 void BrowserPlugin::GuestContentWindowReady(int content_window_routing_id) { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 pending_resize_params_.reset(); | 754 pending_resize_params_.reset(); |
| 754 | 755 |
| 755 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> params( | 756 scoped_ptr<BrowserPluginHostMsg_ResizeGuest_Params> params( |
| 756 new BrowserPluginHostMsg_ResizeGuest_Params); | 757 new BrowserPluginHostMsg_ResizeGuest_Params); |
| 757 | 758 |
| 758 TransportDIB* new_damage_buffer = | 759 TransportDIB* new_damage_buffer = |
| 759 PopulateResizeGuestParameters(params.get(), width(), height()); | 760 PopulateResizeGuestParameters(params.get(), width(), height()); |
| 760 DCHECK(new_damage_buffer); | 761 DCHECK(new_damage_buffer); |
| 761 | 762 |
| 762 if (navigate_src_sent_) { | 763 if (navigate_src_sent_) { |
| 763 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ResizeGuest( | 764 browser_plugin_manager()->Send(new BrowserPluginHostMsg_ResizeGuest( |
| 764 render_view_routing_id_, | 765 render_view_routing_id_, |
| 765 instance_id_, | 766 instance_id_, |
| 766 *params)); | 767 *params)); |
| 767 resize_pending_ = true; | 768 resize_pending_ = true; |
| 768 } else { | 769 } else { |
| 769 // Until an actual navigation occurs, there is no browser-side embedder | 770 // Until an actual navigation occurs, there is no browser-side embedder |
| 770 // present to notify about geometry updates. In this case, after we've | 771 // present to notify about geometry updates. In this case, after we've |
| 771 // updated the BrowserPlugin's state we are done and we do not send a resize | 772 // updated the BrowserPlugin's state we are done and we do not send a resize |
| 772 // message to the browser. | 773 // message to the browser. |
| 773 pending_resize_params_.reset(params.release()); | 774 pending_resize_params_.reset(params.release()); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 TransportDIB* BrowserPlugin::CreateTransportDIB(const size_t size) { | 846 TransportDIB* BrowserPlugin::CreateTransportDIB(const size_t size) { |
| 846 #if defined(OS_MACOSX) | 847 #if defined(OS_MACOSX) |
| 847 TransportDIB::Handle handle; | 848 TransportDIB::Handle handle; |
| 848 // On OSX we don't let the browser manage the transport dib. We manage the | 849 // On OSX we don't let the browser manage the transport dib. We manage the |
| 849 // deletion of the dib in FreeDamageBuffer(). | 850 // deletion of the dib in FreeDamageBuffer(). |
| 850 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB( | 851 IPC::Message* msg = new ViewHostMsg_AllocTransportDIB( |
| 851 size, | 852 size, |
| 852 false, // cache in browser. | 853 false, // cache in browser. |
| 853 &handle); | 854 &handle); |
| 854 TransportDIB* new_damage_buffer = NULL; | 855 TransportDIB* new_damage_buffer = NULL; |
| 855 if (BrowserPluginManager::Get()->Send(msg) && handle.fd >= 0) | 856 if (browser_plugin_manager()->Send(msg) && handle.fd >= 0) |
| 856 new_damage_buffer = TransportDIB::Map(handle); | 857 new_damage_buffer = TransportDIB::Map(handle); |
| 857 #else | 858 #else |
| 858 TransportDIB* new_damage_buffer = | 859 TransportDIB* new_damage_buffer = |
| 859 RenderProcess::current()->CreateTransportDIB(size); | 860 RenderProcess::current()->CreateTransportDIB(size); |
| 860 #endif | 861 #endif |
| 861 if (!new_damage_buffer) | 862 if (!new_damage_buffer) |
| 862 NOTREACHED() << "Unable to create damage buffer"; | 863 NOTREACHED() << "Unable to create damage buffer"; |
| 863 #if defined(OS_WIN) | 864 #if defined(OS_WIN) |
| 864 // Windows does not map the buffer by default. | 865 // Windows does not map the buffer by default. |
| 865 CHECK(new_damage_buffer->Map()); | 866 CHECK(new_damage_buffer->Map()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 882 } | 883 } |
| 883 | 884 |
| 884 void BrowserPlugin::updateVisibility(bool visible) { | 885 void BrowserPlugin::updateVisibility(bool visible) { |
| 885 if (visible_ == visible) | 886 if (visible_ == visible) |
| 886 return; | 887 return; |
| 887 | 888 |
| 888 visible_ = visible; | 889 visible_ = visible; |
| 889 if (!navigate_src_sent_) | 890 if (!navigate_src_sent_) |
| 890 return; | 891 return; |
| 891 | 892 |
| 892 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( | 893 browser_plugin_manager()->Send(new BrowserPluginHostMsg_SetVisibility( |
| 893 render_view_routing_id_, | 894 render_view_routing_id_, |
| 894 instance_id_, | 895 instance_id_, |
| 895 visible)); | 896 visible)); |
| 896 } | 897 } |
| 897 | 898 |
| 898 bool BrowserPlugin::acceptsInputEvents() { | 899 bool BrowserPlugin::acceptsInputEvents() { |
| 899 return true; | 900 return true; |
| 900 } | 901 } |
| 901 | 902 |
| 902 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, | 903 bool BrowserPlugin::handleInputEvent(const WebKit::WebInputEvent& event, |
| 903 WebKit::WebCursorInfo& cursor_info) { | 904 WebKit::WebCursorInfo& cursor_info) { |
| 904 if (guest_crashed_ || !navigate_src_sent_) | 905 if (guest_crashed_ || !navigate_src_sent_) |
| 905 return false; | 906 return false; |
| 906 bool handled = false; | 907 bool handled = false; |
| 907 WebCursor cursor; | 908 WebCursor cursor; |
| 908 IPC::Message* message = | 909 IPC::Message* message = |
| 909 new BrowserPluginHostMsg_HandleInputEvent( | 910 new BrowserPluginHostMsg_HandleInputEvent( |
| 910 render_view_routing_id_, | 911 render_view_routing_id_, |
| 911 &handled); | 912 &handled); |
| 912 message->WriteInt(instance_id_); | 913 message->WriteInt(instance_id_); |
| 913 message->WriteData(reinterpret_cast<const char*>(&plugin_rect_), | 914 message->WriteData(reinterpret_cast<const char*>(&plugin_rect_), |
| 914 sizeof(gfx::Rect)); | 915 sizeof(gfx::Rect)); |
| 915 message->WriteData(reinterpret_cast<const char*>(&event), event.size); | 916 message->WriteData(reinterpret_cast<const char*>(&event), event.size); |
| 916 BrowserPluginManager::Get()->Send(message); | 917 browser_plugin_manager()->Send(message); |
| 917 cursor_.GetCursorInfo(&cursor_info); | 918 cursor_.GetCursorInfo(&cursor_info); |
| 918 return handled; | 919 return handled; |
| 919 } | 920 } |
| 920 | 921 |
| 921 bool BrowserPlugin::handleDragStatusUpdate(WebKit::WebDragStatus drag_status, | 922 bool BrowserPlugin::handleDragStatusUpdate(WebKit::WebDragStatus drag_status, |
| 922 const WebKit::WebDragData& drag_data, | 923 const WebKit::WebDragData& drag_data, |
| 923 WebKit::WebDragOperationsMask mask, | 924 WebKit::WebDragOperationsMask mask, |
| 924 const WebKit::WebPoint& position, | 925 const WebKit::WebPoint& position, |
| 925 const WebKit::WebPoint& screen) { | 926 const WebKit::WebPoint& screen) { |
| 926 if (guest_crashed_ || !navigate_src_sent_) | 927 if (guest_crashed_ || !navigate_src_sent_) |
| 927 return false; | 928 return false; |
| 928 BrowserPluginManager::Get()->Send( | 929 browser_plugin_manager()->Send( |
| 929 new BrowserPluginHostMsg_DragStatusUpdate( | 930 new BrowserPluginHostMsg_DragStatusUpdate( |
| 930 render_view_routing_id_, | 931 render_view_routing_id_, |
| 931 instance_id_, | 932 instance_id_, |
| 932 drag_status, | 933 drag_status, |
| 933 WebDropData(drag_data), | 934 WebDropData(drag_data), |
| 934 mask, | 935 mask, |
| 935 position)); | 936 position)); |
| 936 return false; | 937 return false; |
| 937 } | 938 } |
| 938 | 939 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 953 void* notify_data) { | 954 void* notify_data) { |
| 954 } | 955 } |
| 955 | 956 |
| 956 void BrowserPlugin::didFailLoadingFrameRequest( | 957 void BrowserPlugin::didFailLoadingFrameRequest( |
| 957 const WebKit::WebURL& url, | 958 const WebKit::WebURL& url, |
| 958 void* notify_data, | 959 void* notify_data, |
| 959 const WebKit::WebURLError& error) { | 960 const WebKit::WebURLError& error) { |
| 960 } | 961 } |
| 961 | 962 |
| 962 } // namespace content | 963 } // namespace content |
| OLD | NEW |