OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 } | 2127 } |
2128 | 2128 |
2129 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { | 2129 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { |
2130 return render_view_->GetWebkitPreferences(); | 2130 return render_view_->GetWebkitPreferences(); |
2131 } | 2131 } |
2132 | 2132 |
2133 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, | 2133 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, |
2134 const ContextMenuParams& params) { | 2134 const ContextMenuParams& params) { |
2135 DCHECK(client); // A null client means "internal" when we issue callbacks. | 2135 DCHECK(client); // A null client means "internal" when we issue callbacks. |
2136 ContextMenuParams our_params(params); | 2136 ContextMenuParams our_params(params); |
| 2137 |
| 2138 blink::WebRect position_in_window(params.x, params.y, 0, 0); |
| 2139 GetRenderWidget()->convertViewportToWindow(&position_in_window); |
| 2140 our_params.x = position_in_window.x; |
| 2141 our_params.y = position_in_window.y; |
| 2142 |
2137 our_params.custom_context.request_id = pending_context_menus_.Add(client); | 2143 our_params.custom_context.request_id = pending_context_menus_.Add(client); |
2138 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); | 2144 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); |
2139 return our_params.custom_context.request_id; | 2145 return our_params.custom_context.request_id; |
2140 } | 2146 } |
2141 | 2147 |
2142 void RenderFrameImpl::CancelContextMenu(int request_id) { | 2148 void RenderFrameImpl::CancelContextMenu(int request_id) { |
2143 DCHECK(pending_context_menus_.Lookup(request_id)); | 2149 DCHECK(pending_context_menus_.Lookup(request_id)); |
2144 pending_context_menus_.Remove(request_id); | 2150 pending_context_menus_.Remove(request_id); |
2145 } | 2151 } |
2146 | 2152 |
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5718 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5724 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
5719 scoped_refptr<media::AudioOutputDevice> device = | 5725 scoped_refptr<media::AudioOutputDevice> device = |
5720 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5726 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
5721 security_origin); | 5727 security_origin); |
5722 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5728 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
5723 device->Stop(); | 5729 device->Stop(); |
5724 callback.Run(status); | 5730 callback.Run(status); |
5725 } | 5731 } |
5726 | 5732 |
5727 } // namespace content | 5733 } // namespace content |
OLD | NEW |