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/pepper/renderer_ppapi_host_impl.h" | 5 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 FullscreenContainer* container = plugin_instance->fullscreen_container(); | 196 FullscreenContainer* container = plugin_instance->fullscreen_container(); |
197 return static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); | 197 return static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); |
198 } | 198 } |
199 return GetRenderViewForInstance(instance)->GetRoutingID(); | 199 return GetRenderViewForInstance(instance)->GetRoutingID(); |
200 } | 200 } |
201 | 201 |
202 gfx::Point RendererPpapiHostImpl::PluginPointToRenderFrame( | 202 gfx::Point RendererPpapiHostImpl::PluginPointToRenderFrame( |
203 PP_Instance instance, | 203 PP_Instance instance, |
204 const gfx::Point& pt) const { | 204 const gfx::Point& pt) const { |
205 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); | 205 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); |
206 if (!plugin_instance) | 206 if (!plugin_instance || plugin_instance->flash_fullscreen()) { |
| 207 // Flash fullscreen is special in that it renders into its own separate, |
| 208 // dedicated window. So, do not offset the point. |
207 return pt; | 209 return pt; |
208 | |
209 RenderFrameImpl* render_frame = static_cast<RenderFrameImpl*>( | |
210 GetRenderFrameForInstance(instance)); | |
211 if (plugin_instance->view_data().is_fullscreen || | |
212 plugin_instance->flash_fullscreen()) { | |
213 blink::WebRect window_rect = render_frame->GetRenderWidget()->windowRect(); | |
214 blink::WebRect screen_rect = | |
215 render_frame->GetRenderWidget()->screenInfo().rect; | |
216 return gfx::Point(pt.x() - window_rect.x + screen_rect.x, | |
217 pt.y() - window_rect.y + screen_rect.y); | |
218 } | 210 } |
219 return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x, | 211 return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x, |
220 pt.y() + plugin_instance->view_data().rect.point.y); | 212 pt.y() + plugin_instance->view_data().rect.point.y); |
221 } | 213 } |
222 | 214 |
223 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote( | 215 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote( |
224 base::PlatformFile handle, | 216 base::PlatformFile handle, |
225 bool should_close_source) { | 217 bool should_close_source) { |
226 if (!dispatcher_) { | 218 if (!dispatcher_) { |
227 DCHECK(is_running_in_process_); | 219 DCHECK(is_running_in_process_); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 PepperPluginInstanceImpl* instance = | 262 PepperPluginInstanceImpl* instance = |
271 HostGlobals::Get()->GetInstance(pp_instance); | 263 HostGlobals::Get()->GetInstance(pp_instance); |
272 if (!instance) | 264 if (!instance) |
273 return NULL; | 265 return NULL; |
274 if (!instance->IsValidInstanceOf(module_)) | 266 if (!instance->IsValidInstanceOf(module_)) |
275 return NULL; | 267 return NULL; |
276 return instance; | 268 return instance; |
277 } | 269 } |
278 | 270 |
279 } // namespace content | 271 } // namespace content |
OLD | NEW |