| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1806 | 1806 |
| 1807 ContextMenuParams params; | 1807 ContextMenuParams params; |
| 1808 params.x = position.x(); | 1808 params.x = position.x(); |
| 1809 params.y = position.y(); | 1809 params.y = position.y(); |
| 1810 params.custom_context.is_pepper_menu = true; | 1810 params.custom_context.is_pepper_menu = true; |
| 1811 params.custom_context.request_id = request_id; | 1811 params.custom_context.request_id = request_id; |
| 1812 params.custom_context.render_widget_id = render_widget_id; | 1812 params.custom_context.render_widget_id = render_widget_id; |
| 1813 params.custom_items = menu->menu_data(); | 1813 params.custom_items = menu->menu_data(); |
| 1814 | 1814 |
| 1815 // Transform the position to be in render view's coordinates. | 1815 // Transform the position to be in render view's coordinates. |
| 1816 if (instance->IsFullscreen(instance->pp_instance()) || | 1816 if (instance->view_data().is_fullscreen || |
| 1817 instance->FlashIsFullscreen(instance->pp_instance())) { | 1817 instance->FlashIsFullscreen(instance->pp_instance())) { |
| 1818 WebKit::WebRect rect = render_view_->windowRect(); | 1818 WebKit::WebRect rect = render_view_->windowRect(); |
| 1819 params.x -= rect.x; | 1819 params.x -= rect.x; |
| 1820 params.y -= rect.y; | 1820 params.y -= rect.y; |
| 1821 } else { | 1821 } else { |
| 1822 params.x += instance->position().x(); | 1822 params.x += instance->view_data().rect.point.x; |
| 1823 params.y += instance->position().y(); | 1823 params.y += instance->view_data().rect.point.y; |
| 1824 } | 1824 } |
| 1825 | 1825 |
| 1826 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), | 1826 IPC::Message* msg = new ViewHostMsg_ContextMenu(render_view_->routing_id(), |
| 1827 params); | 1827 params); |
| 1828 if (!render_view_->Send(msg)) { | 1828 if (!render_view_->Send(msg)) { |
| 1829 pending_context_menus_.Remove(request_id); | 1829 pending_context_menus_.Remove(request_id); |
| 1830 return PP_ERROR_FAILED; | 1830 return PP_ERROR_FAILED; |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 return PP_OK_COMPLETIONPENDING; | 1833 return PP_OK_COMPLETIONPENDING; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 | 2147 |
| 2148 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { | 2148 bool PepperPluginDelegateImpl::CanUseSocketAPIs() { |
| 2149 WebView* webview = render_view_->webview(); | 2149 WebView* webview = render_view_->webview(); |
| 2150 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; | 2150 WebFrame* main_frame = webview ? webview->mainFrame() : NULL; |
| 2151 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); | 2151 GURL url(main_frame ? GURL(main_frame->document().url()) : GURL()); |
| 2152 if (!url.is_valid()) | 2152 if (!url.is_valid()) |
| 2153 return false; | 2153 return false; |
| 2154 | 2154 |
| 2155 return content::GetContentClient()->renderer()->AllowSocketAPI(url); | 2155 return content::GetContentClient()->renderer()->AllowSocketAPI(url); |
| 2156 } | 2156 } |
| OLD | NEW |