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/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1272 ContextMenuParams params; | 1272 ContextMenuParams params; |
1273 params.x = position.x(); | 1273 params.x = position.x(); |
1274 params.y = position.y(); | 1274 params.y = position.y(); |
1275 params.custom_context.is_pepper_menu = true; | 1275 params.custom_context.is_pepper_menu = true; |
1276 params.custom_context.request_id = request_id; | 1276 params.custom_context.request_id = request_id; |
1277 params.custom_context.render_widget_id = render_widget_id; | 1277 params.custom_context.render_widget_id = render_widget_id; |
1278 params.custom_items = menu->menu_data(); | 1278 params.custom_items = menu->menu_data(); |
1279 | 1279 |
1280 // Transform the position to be in render view's coordinates. | 1280 // Transform the position to be in render view's coordinates. |
1281 if (instance->view_data().is_fullscreen || instance->flash_fullscreen()) { | 1281 if (instance->view_data().is_fullscreen || instance->flash_fullscreen()) { |
1282 WebKit::WebRect rect = render_view_->windowRect(); | 1282 WebKit::WebRect window_rect = render_view_->windowRect(); |
viettrungluu
2012/08/05 05:55:16
Are you sure this doesn't break multi-monitor full
raymes
2012/08/05 06:19:57
AFAICT this isn't currently used by anything other
| |
1283 params.x -= rect.x; | 1283 WebKit::WebRect screen_rect = render_view_->screenInfo().rect; |
1284 params.y -= rect.y; | 1284 params.x = params.x - window_rect.x + screen_rect.x; |
1285 params.y = params.y - window_rect.y + screen_rect.y; | |
1285 } else { | 1286 } else { |
1286 params.x += instance->view_data().rect.point.x; | 1287 params.x += instance->view_data().rect.point.x; |
1287 params.y += instance->view_data().rect.point.y; | 1288 params.y += instance->view_data().rect.point.y; |
1288 } | 1289 } |
1289 | 1290 |
1290 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), | 1291 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), |
1291 params); | 1292 params); |
1292 if (!render_view_->Send(msg)) { | 1293 if (!render_view_->Send(msg)) { |
1293 pending_context_menus_.Remove(request_id); | 1294 pending_context_menus_.Remove(request_id); |
1294 return PP_ERROR_FAILED; | 1295 return PP_ERROR_FAILED; |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1763 else | 1764 else |
1764 return render_view_->mouse_lock_dispatcher(); | 1765 return render_view_->mouse_lock_dispatcher(); |
1765 } | 1766 } |
1766 | 1767 |
1767 webkit_glue::ClipboardClient* | 1768 webkit_glue::ClipboardClient* |
1768 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1769 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1769 return new RendererClipboardClient; | 1770 return new RendererClipboardClient; |
1770 } | 1771 } |
1771 | 1772 |
1772 } // namespace content | 1773 } // namespace content |
OLD | NEW |