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/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "content/public/renderer/navigation_state.h" | 61 #include "content/public/renderer/navigation_state.h" |
62 #include "content/public/renderer/password_form_conversion_utils.h" | 62 #include "content/public/renderer/password_form_conversion_utils.h" |
63 #include "content/public/renderer/render_view_observer.h" | 63 #include "content/public/renderer/render_view_observer.h" |
64 #include "content/public/renderer/render_view_visitor.h" | 64 #include "content/public/renderer/render_view_visitor.h" |
65 #include "content/renderer/accessibility/renderer_accessibility.h" | 65 #include "content/renderer/accessibility/renderer_accessibility.h" |
66 #include "content/renderer/accessibility/renderer_accessibility_complete.h" | 66 #include "content/renderer/accessibility/renderer_accessibility_complete.h" |
67 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h" | 67 #include "content/renderer/accessibility/renderer_accessibility_focus_only.h" |
68 #include "content/renderer/browser_plugin/browser_plugin.h" | 68 #include "content/renderer/browser_plugin/browser_plugin.h" |
69 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 69 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
70 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 70 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| 71 #include "content/renderer/context_menu_params_builder.h" |
71 #include "content/renderer/device_orientation_dispatcher.h" | 72 #include "content/renderer/device_orientation_dispatcher.h" |
72 #include "content/renderer/devtools/devtools_agent.h" | 73 #include "content/renderer/devtools/devtools_agent.h" |
73 #include "content/renderer/disambiguation_popup_helper.h" | 74 #include "content/renderer/disambiguation_popup_helper.h" |
74 #include "content/renderer/dom_automation_controller.h" | 75 #include "content/renderer/dom_automation_controller.h" |
75 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 76 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
76 #include "content/renderer/external_popup_menu.h" | 77 #include "content/renderer/external_popup_menu.h" |
77 #include "content/renderer/fetchers/alt_error_page_resource_fetcher.h" | 78 #include "content/renderer/fetchers/alt_error_page_resource_fetcher.h" |
78 #include "content/renderer/geolocation_dispatcher.h" | 79 #include "content/renderer/geolocation_dispatcher.h" |
79 #include "content/renderer/gpu/input_handler_manager.h" | 80 #include "content/renderer/gpu/input_handler_manager.h" |
80 #include "content/renderer/gpu/render_widget_compositor.h" | 81 #include "content/renderer/gpu/render_widget_compositor.h" |
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 // response as RunJavaScriptMessage. | 2293 // response as RunJavaScriptMessage. |
2293 string16 ignored_result; | 2294 string16 ignored_result; |
2294 SendAndRunNestedMessageLoop(new ViewHostMsg_RunBeforeUnloadConfirm( | 2295 SendAndRunNestedMessageLoop(new ViewHostMsg_RunBeforeUnloadConfirm( |
2295 routing_id_, frame->document().url(), message, is_reload, | 2296 routing_id_, frame->document().url(), message, is_reload, |
2296 &success, &ignored_result)); | 2297 &success, &ignored_result)); |
2297 return success; | 2298 return success; |
2298 } | 2299 } |
2299 | 2300 |
2300 void RenderViewImpl::showContextMenu( | 2301 void RenderViewImpl::showContextMenu( |
2301 WebFrame* frame, const WebContextMenuData& data) { | 2302 WebFrame* frame, const WebContextMenuData& data) { |
2302 ContextMenuParams params(data); | 2303 ContextMenuParams params = ContextMenuParamsBuilder::Build(data); |
2303 | 2304 |
2304 // Plugins, e.g. PDF, don't currently update the render view when their | 2305 // Plugins, e.g. PDF, don't currently update the render view when their |
2305 // selected text changes, but the context menu params do contain the updated | 2306 // selected text changes, but the context menu params do contain the updated |
2306 // selection. If that's the case, update the render view's state just prior | 2307 // selection. If that's the case, update the render view's state just prior |
2307 // to showing the context menu. | 2308 // to showing the context menu. |
2308 // TODO(asvitkine): http://crbug.com/152432 | 2309 // TODO(asvitkine): http://crbug.com/152432 |
2309 if (ShouldUpdateSelectionTextFromContextMenuParams(selection_text_, | 2310 if (ShouldUpdateSelectionTextFromContextMenuParams(selection_text_, |
2310 selection_text_offset_, | 2311 selection_text_offset_, |
2311 selection_range_, | 2312 selection_range_, |
2312 params)) { | 2313 params)) { |
(...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6528 WebURL url = icon_urls[i].iconURL(); | 6529 WebURL url = icon_urls[i].iconURL(); |
6529 if (!url.isEmpty()) | 6530 if (!url.isEmpty()) |
6530 urls.push_back(FaviconURL(url, | 6531 urls.push_back(FaviconURL(url, |
6531 ToFaviconType(icon_urls[i].iconType()))); | 6532 ToFaviconType(icon_urls[i].iconType()))); |
6532 } | 6533 } |
6533 SendUpdateFaviconURL(urls); | 6534 SendUpdateFaviconURL(urls); |
6534 } | 6535 } |
6535 | 6536 |
6536 | 6537 |
6537 } // namespace content | 6538 } // namespace content |
OLD | NEW |