Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 2082893003: Scale menu position back to viewport in pepper plugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust menu position in pepper plugin Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 gfx::Point RendererPpapiHostImpl::PluginPointToRenderFrame( 207 gfx::Point RendererPpapiHostImpl::PluginPointToRenderFrame(
208 PP_Instance instance, 208 PP_Instance instance,
209 const gfx::Point& pt) const { 209 const gfx::Point& pt) const {
210 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); 210 PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance);
211 if (!plugin_instance || plugin_instance->flash_fullscreen()) { 211 if (!plugin_instance || plugin_instance->flash_fullscreen()) {
212 // Flash fullscreen is special in that it renders into its own separate, 212 // Flash fullscreen is special in that it renders into its own separate,
213 // dedicated window. So, do not offset the point. 213 // dedicated window. So, do not offset the point.
214 return pt; 214 return pt;
215 } 215 }
216 return gfx::Point(pt.x() + plugin_instance->view_data().rect.point.x, 216 return gfx::Point((pt.x() + plugin_instance->view_data().rect.point.x) /
217 pt.y() + plugin_instance->view_data().rect.point.y); 217 viewport_to_dip_scale_,
218 (pt.y() + plugin_instance->view_data().rect.point.y) /
219 viewport_to_dip_scale_);
218 } 220 }
219 221
220 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote( 222 IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote(
221 base::PlatformFile handle, 223 base::PlatformFile handle,
222 bool should_close_source) { 224 bool should_close_source) {
223 if (!dispatcher_) { 225 if (!dispatcher_) {
224 DCHECK(is_running_in_process_); 226 DCHECK(is_running_in_process_);
225 // Duplicate the file handle for in process mode so this function 227 // Duplicate the file handle for in process mode so this function
226 // has the same semantics for both in process mode and out of 228 // has the same semantics for both in process mode and out of
227 // process mode (i.e., the remote side must cloes the handle). 229 // process mode (i.e., the remote side must cloes the handle).
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 PepperPluginInstanceImpl* instance = 283 PepperPluginInstanceImpl* instance =
282 HostGlobals::Get()->GetInstance(pp_instance); 284 HostGlobals::Get()->GetInstance(pp_instance);
283 if (!instance) 285 if (!instance)
284 return NULL; 286 return NULL;
285 if (!instance->IsValidInstanceOf(module_)) 287 if (!instance->IsValidInstanceOf(module_))
286 return NULL; 288 return NULL;
287 return instance; 289 return instance;
288 } 290 }
289 291
290 } // namespace content 292 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698