Chromium Code Reviews| 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/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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
| 44 #include "content/public/common/file_chooser_params.h" | 44 #include "content/public/common/file_chooser_params.h" |
| 45 #include "content/public/common/url_constants.h" | 45 #include "content/public/common/url_constants.h" |
| 46 #include "content/public/renderer/content_renderer_client.h" | 46 #include "content/public/renderer/content_renderer_client.h" |
| 47 #include "content/public/renderer/document_state.h" | 47 #include "content/public/renderer/document_state.h" |
| 48 #include "content/public/renderer/navigation_state.h" | 48 #include "content/public/renderer/navigation_state.h" |
| 49 #include "content/public/renderer/render_view_observer.h" | 49 #include "content/public/renderer/render_view_observer.h" |
| 50 #include "content/public/renderer/render_view_visitor.h" | 50 #include "content/public/renderer/render_view_visitor.h" |
| 51 #include "content/renderer/device_orientation_dispatcher.h" | 51 #include "content/renderer/device_orientation_dispatcher.h" |
| 52 #include "content/renderer/devtools_agent.h" | 52 #include "content/renderer/devtools_agent.h" |
| 53 #include "content/renderer/dom_proxy_installer.h" | |
| 53 #include "content/renderer/external_popup_menu.h" | 54 #include "content/renderer/external_popup_menu.h" |
| 54 #include "content/renderer/geolocation_dispatcher.h" | 55 #include "content/renderer/geolocation_dispatcher.h" |
| 55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 56 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 56 #include "content/renderer/idle_user_detector.h" | 57 #include "content/renderer/idle_user_detector.h" |
| 57 #include "content/renderer/intents_dispatcher.h" | 58 #include "content/renderer/intents_dispatcher.h" |
| 58 #include "content/renderer/java/java_bridge_dispatcher.h" | 59 #include "content/renderer/java/java_bridge_dispatcher.h" |
| 59 #include "content/renderer/load_progress_tracker.h" | 60 #include "content/renderer/load_progress_tracker.h" |
| 60 #include "content/renderer/media/audio_message_filter.h" | 61 #include "content/renderer/media/audio_message_filter.h" |
| 61 #include "content/renderer/media/audio_renderer_impl.h" | 62 #include "content/renderer/media/audio_renderer_impl.h" |
| 62 #include "content/renderer/media/media_stream_impl.h" | 63 #include "content/renderer/media/media_stream_impl.h" |
| 63 #include "content/renderer/media/render_media_log.h" | 64 #include "content/renderer/media/render_media_log.h" |
| 64 #include "content/renderer/mhtml_generator.h" | 65 #include "content/renderer/mhtml_generator.h" |
| 65 #include "content/renderer/notification_provider.h" | 66 #include "content/renderer/notification_provider.h" |
| 66 #include "content/renderer/p2p/socket_dispatcher.h" | 67 #include "content/renderer/p2p/socket_dispatcher.h" |
| 67 #include "content/renderer/plugin_channel_host.h" | 68 #include "content/renderer/plugin_channel_host.h" |
| 69 #include "content/renderer/proxy_view_host.h" | |
| 68 #include "content/renderer/render_process.h" | 70 #include "content/renderer/render_process.h" |
| 69 #include "content/renderer/render_thread_impl.h" | 71 #include "content/renderer/render_thread_impl.h" |
| 70 #include "content/renderer/render_widget_fullscreen_pepper.h" | 72 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| 71 #include "content/renderer/renderer_accessibility.h" | 73 #include "content/renderer/renderer_accessibility.h" |
| 72 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 74 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
| 73 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 75 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
| 74 #include "content/renderer/speech_input_dispatcher.h" | 76 #include "content/renderer/speech_input_dispatcher.h" |
| 75 #include "content/renderer/text_input_client_observer.h" | 77 #include "content/renderer/text_input_client_observer.h" |
| 76 #include "content/renderer/v8_value_converter_impl.h" | 78 #include "content/renderer/v8_value_converter_impl.h" |
| 77 #include "content/renderer/web_ui_bindings.h" | 79 #include "content/renderer/web_ui_bindings.h" |
| 78 #include "content/renderer/webplugin_delegate_proxy.h" | 80 #include "content/renderer/webplugin_delegate_proxy.h" |
| 79 #include "content/renderer/websharedworker_proxy.h" | 81 #include "content/renderer/websharedworker_proxy.h" |
| 80 #include "media/base/filter_collection.h" | 82 #include "media/base/filter_collection.h" |
| 81 #include "media/base/media_switches.h" | 83 #include "media/base/media_switches.h" |
| 82 #include "media/base/message_loop_factory_impl.h" | 84 #include "media/base/message_loop_factory_impl.h" |
| 83 #include "net/base/escape.h" | 85 #include "net/base/escape.h" |
| 84 #include "net/base/net_errors.h" | 86 #include "net/base/net_errors.h" |
| 85 #include "net/http/http_util.h" | 87 #include "net/http/http_util.h" |
| 86 #include "ppapi/c/private/ppb_flash_net_connector.h" | 88 #include "ppapi/c/private/ppb_flash_net_connector.h" |
| 87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" | 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec t.h" |
| 88 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h " | 90 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h " |
| 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
| 90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" | |
| 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" | |
| 91 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h" | 95 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData. h" |
| 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" | 97 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams. h" |
| 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" | 98 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" |
| 95 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 99 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
| 96 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" | 100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" |
| 97 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 101 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
| 98 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 99 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" | 103 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC ontext3D.h" |
| 100 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
| 101 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" | 105 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
| 102 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 103 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 104 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" | 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h" |
| 105 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h" | 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIntentServiceInfo. h" |
| 106 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" | 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" |
| 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" | 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNodeList.h" |
| 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" | 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializer.h" |
| 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" | 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginDocument.h" |
| 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" | 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h" |
| 113 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 117 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
| 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
| 115 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 119 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
| 117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" | 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData .h" |
| 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
| 124 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h" | |
| 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" | 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" |
| 121 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 126 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| 122 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " | 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h " |
| 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h" | 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba cks.h" |
| 124 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 129 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 125 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 130 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 126 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h" | 131 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h" |
| 127 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" | 132 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" |
| 128 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h" | 133 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon se.h" |
| 129 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 134 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 using WebKit::WebApplicationCacheHostClient; | 177 using WebKit::WebApplicationCacheHostClient; |
| 173 using WebKit::WebCString; | 178 using WebKit::WebCString; |
| 174 using WebKit::WebColor; | 179 using WebKit::WebColor; |
| 175 using WebKit::WebColorName; | 180 using WebKit::WebColorName; |
| 176 using WebKit::WebConsoleMessage; | 181 using WebKit::WebConsoleMessage; |
| 177 using WebKit::WebContextMenuData; | 182 using WebKit::WebContextMenuData; |
| 178 using WebKit::WebCookieJar; | 183 using WebKit::WebCookieJar; |
| 179 using WebKit::WebData; | 184 using WebKit::WebData; |
| 180 using WebKit::WebDataSource; | 185 using WebKit::WebDataSource; |
| 181 using WebKit::WebDocument; | 186 using WebKit::WebDocument; |
| 187 using WebKit::WebDOMEvent; | |
| 188 using WebKit::WebDOMMessageEvent; | |
| 182 using WebKit::WebDragData; | 189 using WebKit::WebDragData; |
| 183 using WebKit::WebDragOperation; | 190 using WebKit::WebDragOperation; |
| 184 using WebKit::WebDragOperationsMask; | 191 using WebKit::WebDragOperationsMask; |
| 185 using WebKit::WebEditingAction; | 192 using WebKit::WebEditingAction; |
| 186 using WebKit::WebElement; | 193 using WebKit::WebElement; |
| 187 using WebKit::WebExternalPopupMenu; | 194 using WebKit::WebExternalPopupMenu; |
| 188 using WebKit::WebExternalPopupMenuClient; | 195 using WebKit::WebExternalPopupMenuClient; |
| 189 using WebKit::WebFileChooserCompletion; | 196 using WebKit::WebFileChooserCompletion; |
| 190 using WebKit::WebFileSystem; | 197 using WebKit::WebFileSystem; |
| 191 using WebKit::WebFileSystemCallbacks; | 198 using WebKit::WebFileSystemCallbacks; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 211 using WebKit::WebPluginParams; | 218 using WebKit::WebPluginParams; |
| 212 using WebKit::WebPoint; | 219 using WebKit::WebPoint; |
| 213 using WebKit::WebPopupMenuInfo; | 220 using WebKit::WebPopupMenuInfo; |
| 214 using WebKit::WebRange; | 221 using WebKit::WebRange; |
| 215 using WebKit::WebRect; | 222 using WebKit::WebRect; |
| 216 using WebKit::WebReferrerPolicy; | 223 using WebKit::WebReferrerPolicy; |
| 217 using WebKit::WebScriptSource; | 224 using WebKit::WebScriptSource; |
| 218 using WebKit::WebSearchableFormData; | 225 using WebKit::WebSearchableFormData; |
| 219 using WebKit::WebSecurityOrigin; | 226 using WebKit::WebSecurityOrigin; |
| 220 using WebKit::WebSecurityPolicy; | 227 using WebKit::WebSecurityPolicy; |
| 228 using WebKit::WebSerializedScriptValue; | |
| 221 using WebKit::WebSettings; | 229 using WebKit::WebSettings; |
| 222 using WebKit::WebSharedWorker; | 230 using WebKit::WebSharedWorker; |
| 223 using WebKit::WebSize; | 231 using WebKit::WebSize; |
| 224 using WebKit::WebStorageNamespace; | 232 using WebKit::WebStorageNamespace; |
| 225 using WebKit::WebStorageQuotaCallbacks; | 233 using WebKit::WebStorageQuotaCallbacks; |
| 226 using WebKit::WebStorageQuotaError; | 234 using WebKit::WebStorageQuotaError; |
| 227 using WebKit::WebStorageQuotaType; | 235 using WebKit::WebStorageQuotaType; |
| 228 using WebKit::WebString; | 236 using WebKit::WebString; |
| 229 using WebKit::WebTextAffinity; | 237 using WebKit::WebTextAffinity; |
| 230 using WebKit::WebTextDirection; | 238 using WebKit::WebTextDirection; |
| 231 using WebKit::WebTouchEvent; | 239 using WebKit::WebTouchEvent; |
| 232 using WebKit::WebURL; | 240 using WebKit::WebURL; |
| 233 using WebKit::WebURLError; | 241 using WebKit::WebURLError; |
| 234 using WebKit::WebURLRequest; | 242 using WebKit::WebURLRequest; |
| 235 using WebKit::WebURLResponse; | 243 using WebKit::WebURLResponse; |
| 236 using WebKit::WebVector; | 244 using WebKit::WebVector; |
| 237 using WebKit::WebView; | 245 using WebKit::WebView; |
| 238 using WebKit::WebWidget; | 246 using WebKit::WebWidget; |
| 239 using WebKit::WebWindowFeatures; | 247 using WebKit::WebWindowFeatures; |
| 240 using WebKit::WebWorker; | 248 using WebKit::WebWorker; |
| 241 using WebKit::WebWorkerClient; | 249 using WebKit::WebWorkerClient; |
| 242 using appcache::WebApplicationCacheHostImpl; | 250 using appcache::WebApplicationCacheHostImpl; |
| 243 using base::Time; | 251 using base::Time; |
| 244 using base::TimeDelta; | 252 using base::TimeDelta; |
| 245 using content::DocumentState; | 253 using content::DocumentState; |
| 254 using content::ProxyViewHost; | |
| 246 using content::NavigationState; | 255 using content::NavigationState; |
| 247 using content::RenderThread; | 256 using content::RenderThread; |
| 248 using content::RenderViewObserver; | 257 using content::RenderViewObserver; |
| 249 using content::RenderViewVisitor; | 258 using content::RenderViewVisitor; |
| 250 using content::Referrer; | 259 using content::Referrer; |
| 251 using content::V8ValueConverter; | 260 using content::V8ValueConverter; |
| 252 using webkit_glue::AltErrorPageResourceFetcher; | 261 using webkit_glue::AltErrorPageResourceFetcher; |
| 253 using webkit_glue::FormField; | 262 using webkit_glue::FormField; |
| 254 using webkit_glue::PasswordForm; | 263 using webkit_glue::PasswordForm; |
| 255 using webkit_glue::PasswordFormDomManager; | 264 using webkit_glue::PasswordFormDomManager; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 cached_has_main_frame_vertical_scrollbar_(false), | 364 cached_has_main_frame_vertical_scrollbar_(false), |
| 356 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 365 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
| 357 geolocation_dispatcher_(NULL), | 366 geolocation_dispatcher_(NULL), |
| 358 speech_input_dispatcher_(NULL), | 367 speech_input_dispatcher_(NULL), |
| 359 device_orientation_dispatcher_(NULL), | 368 device_orientation_dispatcher_(NULL), |
| 360 p2p_socket_dispatcher_(NULL), | 369 p2p_socket_dispatcher_(NULL), |
| 361 devtools_agent_(NULL), | 370 devtools_agent_(NULL), |
| 362 renderer_accessibility_(NULL), | 371 renderer_accessibility_(NULL), |
| 363 session_storage_namespace_id_(session_storage_namespace_id), | 372 session_storage_namespace_id_(session_storage_namespace_id), |
| 364 handling_select_range_(false), | 373 handling_select_range_(false), |
| 374 proxy_of_browsing_instance_frame_id_(-1), | |
| 365 #if defined(OS_WIN) | 375 #if defined(OS_WIN) |
| 366 focused_plugin_id_(-1), | 376 focused_plugin_id_(-1), |
| 367 #endif | 377 #endif |
| 368 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 378 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
| 369 routing_id_ = routing_id; | 379 routing_id_ = routing_id; |
| 370 if (opener_id != MSG_ROUTING_NONE) | 380 if (opener_id != MSG_ROUTING_NONE) |
| 371 opener_id_ = opener_id; | 381 opener_id_ = opener_id; |
| 372 | 382 |
| 373 #if defined(ENABLE_NOTIFICATIONS) | 383 #if defined(ENABLE_NOTIFICATIONS) |
| 374 notification_provider_ = new NotificationProvider(this); | 384 notification_provider_ = new NotificationProvider(this); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 697 #endif | 707 #endif |
| 698 #if defined(OS_MACOSX) | 708 #if defined(OS_MACOSX) |
| 699 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) | 709 IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize) |
| 700 #endif | 710 #endif |
| 701 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, | 711 IPC_MESSAGE_HANDLER(ViewMsg_SetHistoryLengthAndPrune, |
| 702 OnSetHistoryLengthAndPrune) | 712 OnSetHistoryLengthAndPrune) |
| 703 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 713 IPC_MESSAGE_HANDLER(ViewMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 704 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) | 714 IPC_MESSAGE_HANDLER(ViewMsg_LockMouse_ACK, OnLockMouseACK) |
| 705 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) | 715 IPC_MESSAGE_HANDLER(ViewMsg_MouseLockLost, OnMouseLockLost) |
| 706 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) | 716 IPC_MESSAGE_HANDLER(JavaBridgeMsg_Init, OnJavaBridgeInit) |
| 717 IPC_MESSAGE_HANDLER(ViewMsg_PostMessage, OnPostMessage) | |
| 718 IPC_MESSAGE_HANDLER(ViewMsg_SetOpenerProxy, OnSetOpenerProxy) | |
| 707 | 719 |
| 708 // Have the super handle all other messages. | 720 // Have the super handle all other messages. |
| 709 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) | 721 IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message)) |
| 710 IPC_END_MESSAGE_MAP() | 722 IPC_END_MESSAGE_MAP() |
| 711 | 723 |
| 712 if (!msg_is_ok) { | 724 if (!msg_is_ok) { |
| 713 // The message had a handler, but its deserialization failed. | 725 // The message had a handler, but its deserialization failed. |
| 714 // Kill the renderer to avoid potential spoofing attacks. | 726 // Kill the renderer to avoid potential spoofing attacks. |
| 715 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; | 727 CHECK(false) << "Unable to deserialize message in RenderViewImpl."; |
| 716 } | 728 } |
| 717 | 729 |
| 718 return handled; | 730 return handled; |
| 719 } | 731 } |
| 720 | 732 |
| 721 void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) { | 733 void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) { |
| 722 if (!webview()) | 734 if (!webview()) |
| 723 return; | 735 return; |
| 724 | 736 |
| 725 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); | 737 FOR_EACH_OBSERVER(RenderViewObserver, observers_, Navigate(params.url)); |
| 726 | 738 |
| 727 bool is_reload = IsReload(params); | 739 bool is_reload = IsReload(params); |
| 728 | 740 |
| 729 // If this is a stale back/forward (due to a recent navigation the browser | 741 // If this is a stale back/forward (due to a recent navigation the browser |
| 730 // didn't know about), ignore it. | 742 // didn't know about), ignore it. |
| 731 if (IsBackForwardToStaleEntry(params, is_reload)) | 743 if (IsBackForwardToStaleEntry(params, is_reload)) |
| 732 return; | 744 return; |
| 733 | 745 |
| 734 // Swap this renderer back in if necessary. | 746 // Swap this renderer back in if necessary. |
| 735 if (is_swapped_out_) | 747 if (is_swapped_out_) { |
| 736 SetSwappedOut(false); | 748 SetSwappedOut(false); |
| 749 proxy_of_browsing_instance_frame_id_ = -1; | |
| 750 } | |
| 737 | 751 |
| 738 history_list_offset_ = params.current_history_list_offset; | 752 history_list_offset_ = params.current_history_list_offset; |
| 739 history_list_length_ = params.current_history_list_length; | 753 history_list_length_ = params.current_history_list_length; |
| 740 if (history_list_length_ >= 0) | 754 if (history_list_length_ >= 0) |
| 741 history_page_ids_.resize(history_list_length_, -1); | 755 history_page_ids_.resize(history_list_length_, -1); |
| 742 if (params.pending_history_list_offset >= 0 && | 756 if (params.pending_history_list_offset >= 0 && |
| 743 params.pending_history_list_offset < history_list_length_) | 757 params.pending_history_list_offset < history_list_length_) |
| 744 history_page_ids_[params.pending_history_list_offset] = params.page_id; | 758 history_page_ids_[params.pending_history_list_offset] = params.page_id; |
| 745 | 759 |
| 746 content::GetContentClient()->SetActiveURL(params.url); | 760 content::GetContentClient()->SetActiveURL(params.url); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 791 | 805 |
| 792 if (!params.extra_headers.empty()) { | 806 if (!params.extra_headers.empty()) { |
| 793 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), | 807 for (net::HttpUtil::HeadersIterator i(params.extra_headers.begin(), |
| 794 params.extra_headers.end(), "\n"); | 808 params.extra_headers.end(), "\n"); |
| 795 i.GetNext(); ) { | 809 i.GetNext(); ) { |
| 796 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), | 810 request.addHTTPHeaderField(WebString::fromUTF8(i.name()), |
| 797 WebString::fromUTF8(i.values())); | 811 WebString::fromUTF8(i.values())); |
| 798 } | 812 } |
| 799 } | 813 } |
| 800 | 814 |
| 815 DLOG(WARNING) << "Navigating to " << params.url << " with opener = " << | |
| 816 params.opener_browsing_instance_frame_id; | |
| 817 | |
| 818 if (params.opener_browsing_instance_frame_id != -1) { | |
| 819 // If the user navigates back to this navigation entry, we don't want to | |
| 820 // recreate the opener proxy. | |
| 821 if (!main_frame->opener()) { | |
| 822 ProxyViewHost* proxy_view_host = new ProxyViewHost( | |
| 823 this, params.opener_browsing_instance_frame_id); | |
| 824 main_frame->setOpener(proxy_view_host->mainFrame()); | |
| 825 } | |
| 826 } | |
| 801 main_frame->loadRequest(request); | 827 main_frame->loadRequest(request); |
| 802 } | 828 } |
| 803 | 829 |
| 804 // In case LoadRequest failed before DidCreateDataSource was called. | 830 // In case LoadRequest failed before DidCreateDataSource was called. |
| 805 pending_navigation_params_.reset(); | 831 pending_navigation_params_.reset(); |
| 806 } | 832 } |
| 807 | 833 |
| 808 bool RenderViewImpl::IsBackForwardToStaleEntry( | 834 bool RenderViewImpl::IsBackForwardToStaleEntry( |
| 809 const ViewMsg_Navigate_Params& params, | 835 const ViewMsg_Navigate_Params& params, |
| 810 bool is_reload) { | 836 bool is_reload) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 942 } | 968 } |
| 943 | 969 |
| 944 void RenderViewImpl::OnPasteAndMatchStyle() { | 970 void RenderViewImpl::OnPasteAndMatchStyle() { |
| 945 if (!webview()) | 971 if (!webview()) |
| 946 return; | 972 return; |
| 947 | 973 |
| 948 webview()->focusedFrame()->executeCommand( | 974 webview()->focusedFrame()->executeCommand( |
| 949 WebString::fromUTF8("PasteAndMatchStyle")); | 975 WebString::fromUTF8("PasteAndMatchStyle")); |
| 950 } | 976 } |
| 951 | 977 |
| 978 void RenderViewImpl::OnPostMessage(int64 frame_id, | |
| 979 const ViewMsg_PostMessage_Params& params) { | |
| 980 // TODO(supersat): support subframes | |
|
Charlie Reis
2011/12/12 22:20:36
What else do you need to support subframes?
supersat
2011/12/15 19:30:49
It depends on how we do subframes. If we put them
| |
| 981 WebFrame *frame = webview()->mainFrame(); | |
| 982 | |
| 983 // We need to check whether we can send this message to the frame, since the | |
| 984 // asynchrony of postMessage means that the target frame's origin can change | |
| 985 // in the middle of a postMessage dispatch | |
| 986 WebSecurityOrigin messageSpecifiedOrigin = | |
| 987 WebSecurityOrigin::createFromString(WebString(params.targetOrigin)); | |
| 988 if (!frame->document().securityOrigin().canReceiveMessagesFor( | |
| 989 &messageSpecifiedOrigin)) | |
| 990 return; | |
| 991 | |
| 992 WebDOMEvent event = frame->document().createEvent("MessageEvent"); | |
| 993 WebDOMMessageEvent msgEvent = event.to<WebDOMMessageEvent>(); | |
| 994 | |
| 995 // TODO(supersat): fix the source frame parameter | |
| 996 msgEvent.initMessageEvent("message", | |
| 997 // canBubble and cancellable are always false | |
| 998 false, false, | |
| 999 WebSerializedScriptValue::fromString(params.data), | |
| 1000 params.sourceOrigin, 0 /* source frame */, | |
| 1001 "" /* last event id, not used with postmsg */); | |
| 1002 | |
| 1003 DLOG(WARNING) << "Dispatching postMessage event"; | |
| 1004 frame->dispatchEvent(msgEvent); | |
| 1005 } | |
| 1006 | |
| 952 void RenderViewImpl::OnReplace(const string16& text) { | 1007 void RenderViewImpl::OnReplace(const string16& text) { |
| 953 if (!webview()) | 1008 if (!webview()) |
| 954 return; | 1009 return; |
| 955 | 1010 |
| 956 WebFrame* frame = webview()->focusedFrame(); | 1011 WebFrame* frame = webview()->focusedFrame(); |
| 957 if (!frame->hasSelection()) | 1012 if (!frame->hasSelection()) |
| 958 frame->selectWordAroundCaret(); | 1013 frame->selectWordAroundCaret(); |
| 959 frame->replaceSelection(text); | 1014 frame->replaceSelection(text); |
| 960 } | 1015 } |
| 961 | 1016 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1242 return; | 1297 return; |
| 1243 | 1298 |
| 1244 Send(new ViewHostMsg_UpdateState( | 1299 Send(new ViewHostMsg_UpdateState( |
| 1245 routing_id_, page_id_, webkit_glue::HistoryItemToString(item))); | 1300 routing_id_, page_id_, webkit_glue::HistoryItemToString(item))); |
| 1246 } | 1301 } |
| 1247 | 1302 |
| 1248 void RenderViewImpl::OpenURL(WebFrame* frame, | 1303 void RenderViewImpl::OpenURL(WebFrame* frame, |
| 1249 const GURL& url, | 1304 const GURL& url, |
| 1250 const Referrer& referrer, | 1305 const Referrer& referrer, |
| 1251 WebNavigationPolicy policy) { | 1306 WebNavigationPolicy policy) { |
| 1252 Send(new ViewHostMsg_OpenURL( | 1307 long long opener_frame_id = -1; |
| 1253 routing_id_, | 1308 if (frame->opener()) { |
| 1254 url, | 1309 opener_frame_id = frame->opener()->identifier(); |
| 1255 referrer, | 1310 } |
| 1256 NavigationPolicyToDisposition(policy), | 1311 |
| 1257 frame->identifier())); | 1312 ViewHostMsg_OpenURL_Params params; |
| 1313 params.url = url; | |
| 1314 params.referrer = referrer; | |
| 1315 params.disposition = NavigationPolicyToDisposition(policy); | |
| 1316 params.source_frame_id = frame->identifier(); | |
| 1317 params.opener_frame_id = opener_frame_id; | |
| 1318 | |
| 1319 Send(new ViewHostMsg_OpenURL(routing_id_, params)); | |
| 1258 } | 1320 } |
| 1259 | 1321 |
| 1260 // WebViewDelegate ------------------------------------------------------------ | 1322 // WebViewDelegate ------------------------------------------------------------ |
| 1261 | 1323 |
| 1262 void RenderViewImpl::LoadNavigationErrorPage( | 1324 void RenderViewImpl::LoadNavigationErrorPage( |
| 1263 WebFrame* frame, | 1325 WebFrame* frame, |
| 1264 const WebURLRequest& failed_request, | 1326 const WebURLRequest& failed_request, |
| 1265 const WebURLError& error, | 1327 const WebURLError& error, |
| 1266 const std::string& html, | 1328 const std::string& html, |
| 1267 bool replace) { | 1329 bool replace) { |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3093 void RenderViewImpl::registerIntentService( | 3155 void RenderViewImpl::registerIntentService( |
| 3094 WebKit::WebFrame* frame, const WebKit::WebIntentServiceInfo& service) { | 3156 WebKit::WebFrame* frame, const WebKit::WebIntentServiceInfo& service) { |
| 3095 Send(new IntentsHostMsg_RegisterIntentService(routing_id_, | 3157 Send(new IntentsHostMsg_RegisterIntentService(routing_id_, |
| 3096 service.action(), | 3158 service.action(), |
| 3097 service.type(), | 3159 service.type(), |
| 3098 service.url().spec().utf16(), | 3160 service.url().spec().utf16(), |
| 3099 service.title(), | 3161 service.title(), |
| 3100 service.disposition())); | 3162 service.disposition())); |
| 3101 } | 3163 } |
| 3102 | 3164 |
| 3165 bool RenderViewImpl::interceptPostMessage(int64 source_frame_id, | |
| 3166 WebKit::WebSecurityOrigin targetOrigin , | |
| 3167 WebKit::WebDOMMessageEvent event) { | |
| 3168 DLOG(WARNING) << "interceptPostMessage called"; | |
| 3169 | |
| 3170 if (!is_swapped_out_) | |
| 3171 return false; | |
| 3172 DCHECK_NE(proxy_of_browsing_instance_frame_id_, -1); | |
| 3173 | |
| 3174 ViewMsg_PostMessage_Params params; | |
| 3175 params.data = event.data().toString(); | |
| 3176 params.sourceOrigin = event.origin(); | |
| 3177 params.targetOrigin = targetOrigin.toString(); | |
| 3178 | |
| 3179 Send(new ViewHostMsg_SendPostMessage( | |
| 3180 proxy_of_browsing_instance_frame_id_, params)); | |
| 3181 return true; | |
| 3182 } | |
| 3183 | |
| 3103 void RenderViewImpl::dispatchIntent(WebKit::WebFrame* frame, | 3184 void RenderViewImpl::dispatchIntent(WebKit::WebFrame* frame, |
| 3104 const WebKit::WebIntent& intent) { | 3185 const WebKit::WebIntent& intent) { |
| 3105 webkit_glue::WebIntentData intent_data(intent); | 3186 webkit_glue::WebIntentData intent_data(intent); |
| 3106 Send(new IntentsHostMsg_WebIntentDispatch( | 3187 Send(new IntentsHostMsg_WebIntentDispatch( |
| 3107 routing_id_, intent_data, intent.identifier())); | 3188 routing_id_, intent_data, intent.identifier())); |
| 3108 } | 3189 } |
| 3109 | 3190 |
| 3110 // WebKit::WebPageSerializerClient implementation ------------------------------ | 3191 // WebKit::WebPageSerializerClient implementation ------------------------------ |
| 3111 | 3192 |
| 3112 void RenderViewImpl::didSerializeDataForFrame( | 3193 void RenderViewImpl::didSerializeDataForFrame( |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3721 host_zoom_levels_[url] = zoom_level; | 3802 host_zoom_levels_[url] = zoom_level; |
| 3722 } | 3803 } |
| 3723 | 3804 |
| 3724 void RenderViewImpl::OnExitFullscreen() { | 3805 void RenderViewImpl::OnExitFullscreen() { |
| 3725 // TODO(darin): Remove this IPC once WebKit has been updated. | 3806 // TODO(darin): Remove this IPC once WebKit has been updated. |
| 3726 #ifndef WEBKIT_HAS_NEW_FULLSCREEN_API | 3807 #ifndef WEBKIT_HAS_NEW_FULLSCREEN_API |
| 3727 webview()->exitFullscreen(); | 3808 webview()->exitFullscreen(); |
| 3728 #endif | 3809 #endif |
| 3729 } | 3810 } |
| 3730 | 3811 |
| 3812 void RenderViewImpl::OnSetOpenerProxy(const ViewMsg_SetOpenerProxy_Params& param s) { | |
| 3813 //webview()->mainFrame()->setOpener(); | |
|
Charlie Reis
2011/12/12 22:20:36
What's the plan for this?
supersat
2011/12/15 19:30:49
Old cruft. It's gone.
| |
| 3814 } | |
| 3815 | |
| 3731 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { | 3816 void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) { |
| 3732 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); | 3817 webview()->setPageEncoding(WebString::fromUTF8(encoding_name)); |
| 3733 } | 3818 } |
| 3734 | 3819 |
| 3735 void RenderViewImpl::OnResetPageEncodingToDefault() { | 3820 void RenderViewImpl::OnResetPageEncodingToDefault() { |
| 3736 WebString no_encoding; | 3821 WebString no_encoding; |
| 3737 webview()->setPageEncoding(no_encoding); | 3822 webview()->setPageEncoding(no_encoding); |
| 3738 } | 3823 } |
| 3739 | 3824 |
| 3740 WebFrame* RenderViewImpl::GetChildFrame(const string16& xpath) const { | 3825 WebFrame* RenderViewImpl::GetChildFrame(const string16& xpath) const { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4018 | 4103 |
| 4019 // Send an UpdateState message before we get swapped out. | 4104 // Send an UpdateState message before we get swapped out. |
| 4020 SyncNavigationState(); | 4105 SyncNavigationState(); |
| 4021 | 4106 |
| 4022 // Synchronously run the unload handler before sending the ACK. | 4107 // Synchronously run the unload handler before sending the ACK. |
| 4023 webview()->dispatchUnloadEvent(); | 4108 webview()->dispatchUnloadEvent(); |
| 4024 | 4109 |
| 4025 // Swap out and stop sending any IPC messages that are not ACKs. | 4110 // Swap out and stop sending any IPC messages that are not ACKs. |
| 4026 SetSwappedOut(true); | 4111 SetSwappedOut(true); |
| 4027 | 4112 |
| 4028 // Replace the page with a blank dummy URL. The unload handler will not be | 4113 // Replace the page with a blank dummy document. The unload handler will not be |
| 4029 // run a second time, thanks to a check in FrameLoader::stopLoading. | 4114 // run a second time, thanks to a check in FrameLoader::stopLoading. |
| 4030 // TODO(creis): Need to add a better way to do this that avoids running the | 4115 // TODO(creis): Need to add a better way to do this that avoids running the |
| 4031 // beforeunload handler. For now, we just run it a second time silently. | 4116 // beforeunload handler. For now, we just run it a second time silently. |
| 4032 webview()->mainFrame()->loadHTMLString(std::string(), | 4117 |
| 4033 GURL("about:swappedout"), | 4118 WebFrame* frame = webview()->mainFrame(); |
| 4034 GURL("about:swappedout"), | 4119 frame->loadHTMLString(std::string(), GURL("about:swappedout"), |
| 4035 false); | 4120 GURL("about:swappedout"), false); |
|
Charlie Reis
2011/12/12 22:20:36
Looks like no change. Why reformat this?
supersat
2011/12/15 19:30:49
This line was changed at one point to use the new
| |
| 4121 | |
| 4122 proxy_of_browsing_instance_frame_id_ = params.browsing_instance_frame_id; | |
| 4036 | 4123 |
| 4037 // Just echo back the params in the ACK. | 4124 // Just echo back the params in the ACK. |
| 4038 Send(new ViewHostMsg_SwapOut_ACK(routing_id_, params)); | 4125 Send(new ViewHostMsg_SwapOut_ACK(routing_id_, params)); |
| 4039 } | 4126 } |
| 4040 | 4127 |
| 4041 void RenderViewImpl::OnClosePage() { | 4128 void RenderViewImpl::OnClosePage() { |
| 4042 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); | 4129 FOR_EACH_OBSERVER(RenderViewObserver, observers_, ClosePage()); |
| 4043 // TODO(creis): We'd rather use webview()->Close() here, but that currently | 4130 // TODO(creis): We'd rather use webview()->Close() here, but that currently |
| 4044 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs | 4131 // sets the WebView's delegate_ to NULL, preventing any JavaScript dialogs |
| 4045 // in the onunload handler from appearing. For now, we're bypassing that and | 4132 // in the onunload handler from appearing. For now, we're bypassing that and |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4788 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4875 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 4789 return !!RenderThreadImpl::current()->compositor_thread(); | 4876 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4790 } | 4877 } |
| 4791 | 4878 |
| 4792 void RenderViewImpl::OnJavaBridgeInit() { | 4879 void RenderViewImpl::OnJavaBridgeInit() { |
| 4793 DCHECK(!java_bridge_dispatcher_.get()); | 4880 DCHECK(!java_bridge_dispatcher_.get()); |
| 4794 #if defined(ENABLE_JAVA_BRIDGE) | 4881 #if defined(ENABLE_JAVA_BRIDGE) |
| 4795 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4882 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
| 4796 #endif | 4883 #endif |
| 4797 } | 4884 } |
| OLD | NEW |