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 #if defined(OS_WIN) | |
80 void WebPluginProxy::SetWindowlessData( | |
81 HANDLE pump_messages_event, gfx::NativeViewId dummy_activation_window) { | |
82 HANDLE pump_messages_event_for_renderer = NULL; | |
83 BrokerDuplicateHandle(pump_messages_event, channel_->peer_pid(), | |
84 &pump_messages_event_for_renderer, | |
85 SYNCHRONIZE | EVENT_MODIFY_STATE, 0); | |
86 DCHECK(pump_messages_event_for_renderer); | |
87 Send(new PluginHostMsg_SetWindowlessData( | |
88 route_id_, pump_messages_event_for_renderer, dummy_activation_window)); | |
89 } | |
90 #endif | |
91 | |
92 void WebPluginProxy::Invalidate() { | 79 void WebPluginProxy::Invalidate() { |
93 gfx::Rect rect(0, 0, | 80 gfx::Rect rect(0, 0, |
94 delegate_->GetRect().width(), | 81 delegate_->GetRect().width(), |
95 delegate_->GetRect().height()); | 82 delegate_->GetRect().height()); |
96 InvalidateRect(rect); | 83 InvalidateRect(rect); |
97 } | 84 } |
98 | 85 |
99 void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { | 86 void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { |
100 #if defined(OS_MACOSX) | 87 #if defined(OS_MACOSX) |
101 // If this is a Core Animation plugin, all we need to do is inform the | 88 // If this is a Core Animation plugin, all we need to do is inform the |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 GetContentClient()->SetActiveURL(page_url_); | 455 GetContentClient()->SetActiveURL(page_url_); |
469 | 456 |
470 Paint(damaged_rect); | 457 Paint(damaged_rect); |
471 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); | 458 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); |
472 } | 459 } |
473 | 460 |
474 bool WebPluginProxy::IsOffTheRecord() { | 461 bool WebPluginProxy::IsOffTheRecord() { |
475 return channel_->incognito(); | 462 return channel_->incognito(); |
476 } | 463 } |
477 | 464 |
478 #if defined(OS_WIN) && !defined(USE_AURA) | |
479 void WebPluginProxy::UpdateIMEStatus() { | |
480 // Retrieve the IME status from a plugin and send it to a renderer process | |
481 // when the plugin has updated it. | |
482 int input_type; | |
483 gfx::Rect caret_rect; | |
484 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | |
485 return; | |
486 | |
487 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | |
488 } | |
489 #endif | |
490 | |
491 } // namespace content | 465 } // namespace content |
OLD | NEW |