| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "chrome/renderer/devtools_agent.h" | 53 #include "chrome/renderer/devtools_agent.h" |
| 54 #include "chrome/renderer/devtools_client.h" | 54 #include "chrome/renderer/devtools_client.h" |
| 55 #include "chrome/renderer/dom_ui_bindings.h" | 55 #include "chrome/renderer/dom_ui_bindings.h" |
| 56 #include "chrome/renderer/extension_groups.h" | 56 #include "chrome/renderer/extension_groups.h" |
| 57 #include "chrome/renderer/extensions/bindings_utils.h" | 57 #include "chrome/renderer/extensions/bindings_utils.h" |
| 58 #include "chrome/renderer/extensions/event_bindings.h" | 58 #include "chrome/renderer/extensions/event_bindings.h" |
| 59 #include "chrome/renderer/extensions/extension_process_bindings.h" | 59 #include "chrome/renderer/extensions/extension_process_bindings.h" |
| 60 #include "chrome/renderer/extensions/extension_renderer_info.h" | 60 #include "chrome/renderer/extensions/extension_renderer_info.h" |
| 61 #include "chrome/renderer/extensions/renderer_extension_bindings.h" | 61 #include "chrome/renderer/extensions/renderer_extension_bindings.h" |
| 62 #include "chrome/renderer/external_host_bindings.h" | 62 #include "chrome/renderer/external_host_bindings.h" |
| 63 #include "chrome/renderer/external_popup_menu.h" |
| 63 #include "chrome/renderer/geolocation_dispatcher_old.h" | 64 #include "chrome/renderer/geolocation_dispatcher_old.h" |
| 64 #include "chrome/renderer/ggl/ggl.h" | 65 #include "chrome/renderer/ggl/ggl.h" |
| 65 #include "chrome/renderer/localized_error.h" | 66 #include "chrome/renderer/localized_error.h" |
| 66 #include "chrome/renderer/media/audio_renderer_impl.h" | 67 #include "chrome/renderer/media/audio_renderer_impl.h" |
| 67 #include "chrome/renderer/media/ipc_video_decoder.h" | 68 #include "chrome/renderer/media/ipc_video_decoder.h" |
| 68 #include "chrome/renderer/media/ipc_video_renderer.h" | 69 #include "chrome/renderer/media/ipc_video_renderer.h" |
| 69 #include "chrome/renderer/navigation_state.h" | 70 #include "chrome/renderer/navigation_state.h" |
| 70 #include "chrome/renderer/notification_provider.h" | 71 #include "chrome/renderer/notification_provider.h" |
| 71 #include "chrome/renderer/page_click_tracker.h" | 72 #include "chrome/renderer/page_click_tracker.h" |
| 72 #include "chrome/renderer/password_autocomplete_manager.h" | 73 #include "chrome/renderer/password_autocomplete_manager.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 using WebKit::WebContextMenuData; | 194 using WebKit::WebContextMenuData; |
| 194 using WebKit::WebCookieJar; | 195 using WebKit::WebCookieJar; |
| 195 using WebKit::WebData; | 196 using WebKit::WebData; |
| 196 using WebKit::WebDataSource; | 197 using WebKit::WebDataSource; |
| 197 using WebKit::WebDevToolsAgent; | 198 using WebKit::WebDevToolsAgent; |
| 198 using WebKit::WebDocument; | 199 using WebKit::WebDocument; |
| 199 using WebKit::WebDragData; | 200 using WebKit::WebDragData; |
| 200 using WebKit::WebDragOperation; | 201 using WebKit::WebDragOperation; |
| 201 using WebKit::WebDragOperationsMask; | 202 using WebKit::WebDragOperationsMask; |
| 202 using WebKit::WebEditingAction; | 203 using WebKit::WebEditingAction; |
| 204 using WebKit::WebExternalPopupMenu; |
| 205 using WebKit::WebExternalPopupMenuClient; |
| 203 using WebKit::WebFileChooserCompletion; | 206 using WebKit::WebFileChooserCompletion; |
| 204 using WebKit::WebFileSystem; | 207 using WebKit::WebFileSystem; |
| 205 using WebKit::WebFileSystemCallbacks; | 208 using WebKit::WebFileSystemCallbacks; |
| 206 using WebKit::WebFindOptions; | 209 using WebKit::WebFindOptions; |
| 207 using WebKit::WebFormControlElement; | 210 using WebKit::WebFormControlElement; |
| 208 using WebKit::WebFormElement; | 211 using WebKit::WebFormElement; |
| 209 using WebKit::WebFrame; | 212 using WebKit::WebFrame; |
| 210 using WebKit::WebHistoryItem; | 213 using WebKit::WebHistoryItem; |
| 211 using WebKit::WebImage; | 214 using WebKit::WebImage; |
| 212 using WebKit::WebInputElement; | 215 using WebKit::WebInputElement; |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 OnCustomContextMenuAction) | 840 OnCustomContextMenuAction) |
| 838 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) | 841 IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) |
| 839 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) | 842 IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) |
| 840 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) | 843 IPC_MESSAGE_HANDLER(ViewMsg_EnableAccessibility, OnEnableAccessibility) |
| 841 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityFocus, OnSetAccessibilityFocus) | 844 IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityFocus, OnSetAccessibilityFocus) |
| 842 IPC_MESSAGE_HANDLER(ViewMsg_AccessibilityDoDefaultAction, | 845 IPC_MESSAGE_HANDLER(ViewMsg_AccessibilityDoDefaultAction, |
| 843 OnAccessibilityDoDefaultAction) | 846 OnAccessibilityDoDefaultAction) |
| 844 IPC_MESSAGE_HANDLER(ViewMsg_AccessibilityNotifications_ACK, | 847 IPC_MESSAGE_HANDLER(ViewMsg_AccessibilityNotifications_ACK, |
| 845 OnAccessibilityNotificationsAck) | 848 OnAccessibilityNotificationsAck) |
| 846 IPC_MESSAGE_HANDLER(ViewMsg_AsyncOpenFile_ACK, OnAsyncFileOpened) | 849 IPC_MESSAGE_HANDLER(ViewMsg_AsyncOpenFile_ACK, OnAsyncFileOpened) |
| 850 #if defined(OS_MACOSX) |
| 851 IPC_MESSAGE_HANDLER(ViewMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 852 #endif |
| 847 | 853 |
| 848 // Have the super handle all other messages. | 854 // Have the super handle all other messages. |
| 849 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) | 855 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
| 850 IPC_END_MESSAGE_MAP() | 856 IPC_END_MESSAGE_MAP() |
| 851 } | 857 } |
| 852 | 858 |
| 853 void RenderView::OnCaptureThumbnail() { | 859 void RenderView::OnCaptureThumbnail() { |
| 854 WebFrame* main_frame = webview()->mainFrame(); | 860 WebFrame* main_frame = webview()->mainFrame(); |
| 855 if (!main_frame) | 861 if (!main_frame) |
| 856 return; | 862 return; |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 } | 1818 } |
| 1813 | 1819 |
| 1814 WebWidget* RenderView::createPopupMenu(const WebPopupMenuInfo& info) { | 1820 WebWidget* RenderView::createPopupMenu(const WebPopupMenuInfo& info) { |
| 1815 RenderWidget* widget = RenderWidget::Create(routing_id_, | 1821 RenderWidget* widget = RenderWidget::Create(routing_id_, |
| 1816 render_thread_, | 1822 render_thread_, |
| 1817 WebKit::WebPopupTypeSelect); | 1823 WebKit::WebPopupTypeSelect); |
| 1818 widget->ConfigureAsExternalPopupMenu(info); | 1824 widget->ConfigureAsExternalPopupMenu(info); |
| 1819 return widget->webwidget(); | 1825 return widget->webwidget(); |
| 1820 } | 1826 } |
| 1821 | 1827 |
| 1828 WebExternalPopupMenu* RenderView::createExternalPopupMenu( |
| 1829 const WebPopupMenuInfo& popup_menu_info, |
| 1830 WebExternalPopupMenuClient* popup_menu_client) { |
| 1831 DCHECK(!external_popup_menu_.get()); |
| 1832 external_popup_menu_.reset( |
| 1833 new ExternalPopupMenu(this, popup_menu_info, popup_menu_client)); |
| 1834 return external_popup_menu_.get(); |
| 1835 } |
| 1836 |
| 1822 WebWidget* RenderView::createFullscreenWindow(WebKit::WebPopupType popup_type) { | 1837 WebWidget* RenderView::createFullscreenWindow(WebKit::WebPopupType popup_type) { |
| 1823 RenderWidget* widget = RenderWidgetFullscreen::Create(routing_id_, | 1838 RenderWidget* widget = RenderWidgetFullscreen::Create(routing_id_, |
| 1824 render_thread_, | 1839 render_thread_, |
| 1825 popup_type); | 1840 popup_type); |
| 1826 return widget->webwidget(); | 1841 return widget->webwidget(); |
| 1827 } | 1842 } |
| 1828 | 1843 |
| 1829 pepper::FullscreenContainer* RenderView::CreatePepperFullscreenContainer( | 1844 pepper::FullscreenContainer* RenderView::CreatePepperFullscreenContainer( |
| 1830 pepper::PluginInstance* plugin) { | 1845 pepper::PluginInstance* plugin) { |
| 1831 RenderWidgetFullscreenPepper* widget = | 1846 RenderWidgetFullscreenPepper* widget = |
| (...skipping 4219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6051 } | 6066 } |
| 6052 | 6067 |
| 6053 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, | 6068 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, |
| 6054 IPC::PlatformFileForTransit file_for_transit, | 6069 IPC::PlatformFileForTransit file_for_transit, |
| 6055 int message_id) { | 6070 int message_id) { |
| 6056 pepper_delegate_.OnAsyncFileOpened( | 6071 pepper_delegate_.OnAsyncFileOpened( |
| 6057 error_code, | 6072 error_code, |
| 6058 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), | 6073 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), |
| 6059 message_id); | 6074 message_id); |
| 6060 } | 6075 } |
| 6076 |
| 6077 #if defined(OS_MACOSX) |
| 6078 void RenderView::OnSelectPopupMenuItem(int selected_index) { |
| 6079 external_popup_menu_->DidSelectItem(selected_index); |
| 6080 external_popup_menu_.reset(); |
| 6081 } |
| 6082 #endif |
| OLD | NEW |