| 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 "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 | 8 |
| 9 #include "generated_resources.h" | 9 #include "generated_resources.h" |
| 10 | 10 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 for (int i = 0; i < argc; ++i) { | 239 for (int i = 0; i < argc; ++i) { |
| 240 params.arg_names.push_back(argn[i]); | 240 params.arg_names.push_back(argn[i]); |
| 241 params.arg_values.push_back(argv[i]); | 241 params.arg_values.push_back(argv[i]); |
| 242 | 242 |
| 243 if (LowerCaseEqualsASCII(params.arg_names.back(), "wmode") && | 243 if (LowerCaseEqualsASCII(params.arg_names.back(), "wmode") && |
| 244 LowerCaseEqualsASCII(params.arg_values.back(), "transparent")) { | 244 LowerCaseEqualsASCII(params.arg_values.back(), "transparent")) { |
| 245 transparent_ = true; | 245 transparent_ = true; |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 params.load_manually = load_manually; | 248 params.load_manually = load_manually; |
| 249 params.modal_dialog_event = render_view_->modal_dialog_event(); | 249 params.modal_dialog_event = render_view_->modal_dialog_event()->handle(); |
| 250 | 250 |
| 251 plugin_ = plugin; | 251 plugin_ = plugin; |
| 252 | 252 |
| 253 result = false; | 253 result = false; |
| 254 IPC::Message* msg = new PluginMsg_Init(instance_id_, params, &result); | 254 IPC::Message* msg = new PluginMsg_Init(instance_id_, params, &result); |
| 255 Send(msg); | 255 Send(msg); |
| 256 | 256 |
| 257 return result; | 257 return result; |
| 258 } | 258 } |
| 259 | 259 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 564 |
| 565 bool WebPluginDelegateProxy::HandleEvent(NPEvent* event, WebCursor* cursor) { | 565 bool WebPluginDelegateProxy::HandleEvent(NPEvent* event, WebCursor* cursor) { |
| 566 bool handled; | 566 bool handled; |
| 567 // A windowless plugin can enter a modal loop in the context of a | 567 // A windowless plugin can enter a modal loop in the context of a |
| 568 // NPP_HandleEvent call, in which case we need to pump messages to | 568 // NPP_HandleEvent call, in which case we need to pump messages to |
| 569 // the plugin. We pass of the corresponding event handle to the | 569 // the plugin. We pass of the corresponding event handle to the |
| 570 // plugin process, which is set if the plugin does enter a modal loop. | 570 // plugin process, which is set if the plugin does enter a modal loop. |
| 571 IPC::SyncMessage* message = new PluginMsg_HandleEvent(instance_id_, | 571 IPC::SyncMessage* message = new PluginMsg_HandleEvent(instance_id_, |
| 572 *event, &handled, | 572 *event, &handled, |
| 573 cursor); | 573 cursor); |
| 574 message->set_pump_messages_event(modal_loop_pump_messages_event_); | 574 message->set_pump_messages_event(modal_loop_pump_messages_event_.get()); |
| 575 Send(message); | 575 Send(message); |
| 576 return handled; | 576 return handled; |
| 577 } | 577 } |
| 578 | 578 |
| 579 int WebPluginDelegateProxy::GetProcessId() { | 579 int WebPluginDelegateProxy::GetProcessId() { |
| 580 return channel_host_->peer_pid(); | 580 return channel_host_->peer_pid(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 void WebPluginDelegateProxy::OnSetWindow( | 583 void WebPluginDelegateProxy::OnSetWindow( |
| 584 HWND window, HANDLE modal_loop_pump_messages_event) { | 584 HWND window, HANDLE modal_loop_pump_messages_event) { |
| 585 windowless_ = window == NULL; | 585 windowless_ = window == NULL; |
| 586 if (plugin_) | 586 if (plugin_) |
| 587 plugin_->SetWindow(window, modal_loop_pump_messages_event); | 587 plugin_->SetWindow(window, modal_loop_pump_messages_event); |
| 588 | 588 |
| 589 DCHECK(modal_loop_pump_messages_event_ == NULL); | 589 DCHECK(modal_loop_pump_messages_event_ == NULL); |
| 590 modal_loop_pump_messages_event_.Set(modal_loop_pump_messages_event); | 590 modal_loop_pump_messages_event_.reset(); |
| 591 } | 591 } |
| 592 | 592 |
| 593 void WebPluginDelegateProxy::OnCancelResource(int id) { | 593 void WebPluginDelegateProxy::OnCancelResource(int id) { |
| 594 if (plugin_) | 594 if (plugin_) |
| 595 plugin_->CancelResource(id); | 595 plugin_->CancelResource(id); |
| 596 } | 596 } |
| 597 | 597 |
| 598 void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) { | 598 void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) { |
| 599 if (!plugin_) | 599 if (!plugin_) |
| 600 return; | 600 return; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 plugin_->CancelDocumentLoad(); | 752 plugin_->CancelDocumentLoad(); |
| 753 } | 753 } |
| 754 | 754 |
| 755 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 755 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 756 const std::string& url, const std::string& range_info, | 756 const std::string& url, const std::string& range_info, |
| 757 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { | 757 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { |
| 758 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 758 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 759 existing_stream, notify_needed, | 759 existing_stream, notify_needed, |
| 760 notify_data); | 760 notify_data); |
| 761 } | 761 } |
| OLD | NEW |