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 4275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4286 | 4286 |
4287 return ScheduleFileChooser(ipc_params, chooser_completion); | 4287 return ScheduleFileChooser(ipc_params, chooser_completion); |
4288 } | 4288 } |
4289 | 4289 |
4290 void RenderFrameImpl::ShowContextMenu(const blink::WebContextMenuData& data) { | 4290 void RenderFrameImpl::ShowContextMenu(const blink::WebContextMenuData& data) { |
4291 ContextMenuParams params = ContextMenuParamsBuilder::Build(data); | 4291 ContextMenuParams params = ContextMenuParamsBuilder::Build(data); |
4292 blink::WebRect position_in_window(params.x, params.y, 0, 0); | 4292 blink::WebRect position_in_window(params.x, params.y, 0, 0); |
4293 GetRenderWidget()->ConvertViewportToWindow(&position_in_window); | 4293 GetRenderWidget()->ConvertViewportToWindow(&position_in_window); |
4294 params.x = position_in_window.x; | 4294 params.x = position_in_window.x; |
4295 params.y = position_in_window.y; | 4295 params.y = position_in_window.y; |
4296 params.source_type = | 4296 if (params.source_type == ui::MENU_SOURCE_NONE) { |
4297 GetRenderWidget()->input_handler().context_menu_source_type(); | 4297 params.source_type = |
4298 GetRenderWidget()->input_handler().context_menu_source_type(); | |
boliu
2017/05/23 17:34:13
pass this into Builder, instead of having this bri
amaralp1
2017/05/24 08:30:34
I decided to remove the SelectAll plumbing from th
| |
4299 } | |
4300 | |
4298 GetRenderWidget()->OnShowHostContextMenu(¶ms); | 4301 GetRenderWidget()->OnShowHostContextMenu(¶ms); |
4299 if (GetRenderWidget()->has_host_context_menu_location()) { | 4302 if (GetRenderWidget()->has_host_context_menu_location()) { |
4300 params.x = GetRenderWidget()->host_context_menu_location().x(); | 4303 params.x = GetRenderWidget()->host_context_menu_location().x(); |
4301 params.y = GetRenderWidget()->host_context_menu_location().y(); | 4304 params.y = GetRenderWidget()->host_context_menu_location().y(); |
4302 } | 4305 } |
4303 | 4306 |
4304 // Serializing a GURL longer than kMaxURLChars will fail, so don't do | 4307 // Serializing a GURL longer than kMaxURLChars will fail, so don't do |
4305 // it. We replace it with an empty GURL so the appropriate items are disabled | 4308 // it. We replace it with an empty GURL so the appropriate items are disabled |
4306 // in the context menu. | 4309 // in the context menu. |
4307 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large | 4310 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large |
(...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7063 policy(info.default_policy), | 7066 policy(info.default_policy), |
7064 replaces_current_history_item(info.replaces_current_history_item), | 7067 replaces_current_history_item(info.replaces_current_history_item), |
7065 history_navigation_in_new_child_frame( | 7068 history_navigation_in_new_child_frame( |
7066 info.is_history_navigation_in_new_child_frame), | 7069 info.is_history_navigation_in_new_child_frame), |
7067 client_redirect(info.is_client_redirect), | 7070 client_redirect(info.is_client_redirect), |
7068 cache_disabled(info.is_cache_disabled), | 7071 cache_disabled(info.is_cache_disabled), |
7069 form(info.form), | 7072 form(info.form), |
7070 source_location(info.source_location) {} | 7073 source_location(info.source_location) {} |
7071 | 7074 |
7072 } // namespace content | 7075 } // namespace content |
OLD | NEW |