| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const { | 146 bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const { |
| 147 return !!GetAndValidateInstance(instance); | 147 return !!GetAndValidateInstance(instance); |
| 148 } | 148 } |
| 149 | 149 |
| 150 PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance( | 150 PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance( |
| 151 PP_Instance instance) const { | 151 PP_Instance instance) const { |
| 152 return GetAndValidateInstance(instance); | 152 return GetAndValidateInstance(instance); |
| 153 } | 153 } |
| 154 | 154 |
| 155 WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( | 155 blink::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( |
| 156 PP_Instance instance) const { | 156 PP_Instance instance) const { |
| 157 PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); | 157 PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); |
| 158 if (!instance_object) | 158 if (!instance_object) |
| 159 return NULL; | 159 return NULL; |
| 160 return instance_object->container(); | 160 return instance_object->container(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 base::ProcessId RendererPpapiHostImpl::GetPluginPID() const { | 163 base::ProcessId RendererPpapiHostImpl::GetPluginPID() const { |
| 164 if (dispatcher_) | 164 if (dispatcher_) |
| 165 return dispatcher_->channel()->peer_pid(); | 165 return dispatcher_->channel()->peer_pid(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 192 PP_Instance instance, | 192 PP_Instance instance, |
| 193 const gfx::Point& pt) const { | 193 const gfx::Point& pt) const { |
| 194 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); | 194 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); |
| 195 if (!plugin_instance) | 195 if (!plugin_instance) |
| 196 return pt; | 196 return pt; |
| 197 | 197 |
| 198 RenderViewImpl* render_view = static_cast<RenderViewImpl*>( | 198 RenderViewImpl* render_view = static_cast<RenderViewImpl*>( |
| 199 GetRenderViewForInstance(instance)); | 199 GetRenderViewForInstance(instance)); |
| 200 if (plugin_instance->view_data().is_fullscreen || | 200 if (plugin_instance->view_data().is_fullscreen || |
| 201 plugin_instance->flash_fullscreen()) { | 201 plugin_instance->flash_fullscreen()) { |
| 202 WebKit::WebRect window_rect = render_view->windowRect(); | 202 blink::WebRect window_rect = render_view->windowRect(); |
| 203 WebKit::WebRect screen_rect = render_view->screenInfo().rect; | 203 blink::WebRect screen_rect = render_view->screenInfo().rect; |
| 204 return gfx::Point(pt.x() - window_rect.x + screen_rect.x, | 204 return gfx::Point(pt.x() - window_rect.x + screen_rect.x, |
| 205 pt.y() - window_rect.y + screen_rect.y); | 205 pt.y() - window_rect.y + screen_rect.y); |
| 206 } | 206 } |
| 207 return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x, | 207 return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x, |
| 208 pt.y() + plugin_instance->view_data().rect.point.y); | 208 pt.y() + plugin_instance->view_data().rect.point.y); |
| 209 } | 209 } |
| 210 | 210 |
| 211 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote( | 211 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote( |
| 212 base::PlatformFile handle, | 212 base::PlatformFile handle, |
| 213 bool should_close_source) { | 213 bool should_close_source) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 PepperPluginInstanceImpl* instance = | 258 PepperPluginInstanceImpl* instance = |
| 259 HostGlobals::Get()->GetInstance(pp_instance); | 259 HostGlobals::Get()->GetInstance(pp_instance); |
| 260 if (!instance) | 260 if (!instance) |
| 261 return NULL; | 261 return NULL; |
| 262 if (!instance->IsValidInstanceOf(module_)) | 262 if (!instance->IsValidInstanceOf(module_)) |
| 263 return NULL; | 263 return NULL; |
| 264 return instance; | 264 return instance; |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace content | 267 } // namespace content |
| OLD | NEW |