| 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/plugin/webplugin_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (plugin_element_) | 69 if (plugin_element_) |
| 70 WebBindings::releaseObject(plugin_element_); | 70 WebBindings::releaseObject(plugin_element_); |
| 71 if (window_npobject_) | 71 if (window_npobject_) |
| 72 WebBindings::releaseObject(window_npobject_); | 72 WebBindings::releaseObject(window_npobject_); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool WebPluginProxy::Send(IPC::Message* msg) { | 75 bool WebPluginProxy::Send(IPC::Message* msg) { |
| 76 return channel_->Send(msg); | 76 return channel_->Send(msg); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void WebPluginProxy::SetWindow(gfx::PluginWindowHandle window) { | |
| 80 Send(new PluginHostMsg_SetWindow(route_id_, window)); | |
| 81 } | |
| 82 | |
| 83 void WebPluginProxy::SetAcceptsInputEvents(bool accepts) { | |
| 84 NOTREACHED(); | |
| 85 } | |
| 86 | |
| 87 void WebPluginProxy::WillDestroyWindow(gfx::PluginWindowHandle window) { | |
| 88 #if defined(OS_WIN) | |
| 89 PluginThread::current()->Send( | |
| 90 new PluginProcessHostMsg_PluginWindowDestroyed( | |
| 91 window, ::GetParent(window))); | |
| 92 #else | |
| 93 NOTIMPLEMENTED(); | |
| 94 #endif | |
| 95 } | |
| 96 | |
| 97 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
| 98 void WebPluginProxy::SetWindowlessData( | 80 void WebPluginProxy::SetWindowlessData( |
| 99 HANDLE pump_messages_event, gfx::NativeViewId dummy_activation_window) { | 81 HANDLE pump_messages_event, gfx::NativeViewId dummy_activation_window) { |
| 100 HANDLE pump_messages_event_for_renderer = NULL; | 82 HANDLE pump_messages_event_for_renderer = NULL; |
| 101 BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(), | 83 BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(), |
| 102 &pump_messages_event_for_renderer, | 84 &pump_messages_event_for_renderer, |
| 103 SYNCHRONIZE | EVENT_MODIFY_STATE, 0); | 85 SYNCHRONIZE | EVENT_MODIFY_STATE, 0); |
| 104 DCHECK(pump_messages_event_for_renderer); | 86 DCHECK(pump_messages_event_for_renderer); |
| 105 Send(new PluginHostMsg_SetWindowlessData( | 87 Send(new PluginHostMsg_SetWindowlessData( |
| 106 route_id_, pump_messages_event_for_renderer, dummy_activation_window)); | 88 route_id_, pump_messages_event_for_renderer, dummy_activation_window)); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 316 |
| 335 #if defined(OS_MACOSX) | 317 #if defined(OS_MACOSX) |
| 336 delegate_->UpdateGeometryAndContext( | 318 delegate_->UpdateGeometryAndContext( |
| 337 window_rect, clip_rect, windowless_context()); | 319 window_rect, clip_rect, windowless_context()); |
| 338 #else | 320 #else |
| 339 delegate_->UpdateGeometry(window_rect, clip_rect); | 321 delegate_->UpdateGeometry(window_rect, clip_rect); |
| 340 #endif | 322 #endif |
| 341 | 323 |
| 342 // Send over any pending invalidates which occured when the plugin was | 324 // Send over any pending invalidates which occured when the plugin was |
| 343 // off screen. | 325 // off screen. |
| 344 if (delegate_->IsWindowless() && !clip_rect.IsEmpty() && | 326 if (!clip_rect.IsEmpty() && !damaged_rect_.IsEmpty()) { |
| 345 !damaged_rect_.IsEmpty()) { | |
| 346 InvalidateRect(damaged_rect_); | 327 InvalidateRect(damaged_rect_); |
| 347 } | 328 } |
| 348 } | 329 } |
| 349 | 330 |
| 350 #if defined(OS_WIN) | 331 #if defined(OS_WIN) |
| 351 | 332 |
| 352 void WebPluginProxy::CreateCanvasFromHandle( | 333 void WebPluginProxy::CreateCanvasFromHandle( |
| 353 const TransportDIB::Handle& dib_handle, | 334 const TransportDIB::Handle& dib_handle, |
| 354 const gfx::Rect& window_rect, | 335 const gfx::Rect& window_rect, |
| 355 skia::RefPtr<SkCanvas>* canvas) { | 336 skia::RefPtr<SkCanvas>* canvas) { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 int input_type; | 482 int input_type; |
| 502 gfx::Rect caret_rect; | 483 gfx::Rect caret_rect; |
| 503 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 484 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
| 504 return; | 485 return; |
| 505 | 486 |
| 506 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 487 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
| 507 } | 488 } |
| 508 #endif | 489 #endif |
| 509 | 490 |
| 510 } // namespace content | 491 } // namespace content |
| OLD | NEW |