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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
50 #include "content/public/common/context_menu_params.h" | 50 #include "content/public/common/context_menu_params.h" |
51 #include "content/public/common/file_chooser_params.h" | 51 #include "content/public/common/file_chooser_params.h" |
52 #include "content/public/common/selected_file_info.h" | 52 #include "content/public/common/selected_file_info.h" |
53 #include "content/public/common/url_constants.h" | 53 #include "content/public/common/url_constants.h" |
54 #include "content/public/renderer/content_renderer_client.h" | 54 #include "content/public/renderer/content_renderer_client.h" |
55 #include "content/public/renderer/document_state.h" | 55 #include "content/public/renderer/document_state.h" |
56 #include "content/public/renderer/navigation_state.h" | 56 #include "content/public/renderer/navigation_state.h" |
57 #include "content/public/renderer/render_view_observer.h" | 57 #include "content/public/renderer/render_view_observer.h" |
58 #include "content/public/renderer/render_view_visitor.h" | 58 #include "content/public/renderer/render_view_visitor.h" |
| 59 #include "content/renderer/browser_plugin/browser_plugin.h" |
59 #include "content/renderer/browser_plugin/browser_plugin_channel_manager.h" | 60 #include "content/renderer/browser_plugin/browser_plugin_channel_manager.h" |
| 61 #include "content/renderer/browser_plugin/browser_plugin_constants.h" |
60 #include "content/renderer/browser_plugin/guest_to_embedder_channel.h" | 62 #include "content/renderer/browser_plugin/guest_to_embedder_channel.h" |
61 #include "content/renderer/device_orientation_dispatcher.h" | 63 #include "content/renderer/device_orientation_dispatcher.h" |
62 #include "content/renderer/devtools_agent.h" | 64 #include "content/renderer/devtools_agent.h" |
63 #include "content/renderer/dom_automation_controller.h" | 65 #include "content/renderer/dom_automation_controller.h" |
64 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 66 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
65 #include "content/renderer/external_popup_menu.h" | 67 #include "content/renderer/external_popup_menu.h" |
66 #include "content/renderer/geolocation_dispatcher.h" | 68 #include "content/renderer/geolocation_dispatcher.h" |
67 #include "content/renderer/gpu/compositor_thread.h" | 69 #include "content/renderer/gpu/compositor_thread.h" |
68 #include "content/renderer/idle_user_detector.h" | 70 #include "content/renderer/idle_user_detector.h" |
69 #include "content/renderer/input_tag_speech_dispatcher.h" | 71 #include "content/renderer/input_tag_speech_dispatcher.h" |
70 #include "content/renderer/java/java_bridge_dispatcher.h" | 72 #include "content/renderer/java/java_bridge_dispatcher.h" |
71 #include "content/renderer/load_progress_tracker.h" | 73 #include "content/renderer/load_progress_tracker.h" |
72 #include "content/renderer/media/audio_message_filter.h" | 74 #include "content/renderer/media/audio_message_filter.h" |
73 #include "content/renderer/media/media_stream_dependency_factory.h" | 75 #include "content/renderer/media/media_stream_dependency_factory.h" |
74 #include "content/renderer/media/media_stream_dispatcher.h" | 76 #include "content/renderer/media/media_stream_dispatcher.h" |
75 #include "content/renderer/media/media_stream_impl.h" | 77 #include "content/renderer/media/media_stream_impl.h" |
76 #include "content/renderer/media/render_audiosourceprovider.h" | 78 #include "content/renderer/media/render_audiosourceprovider.h" |
77 #include "content/renderer/media/render_media_log.h" | 79 #include "content/renderer/media/render_media_log.h" |
78 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 80 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
79 #include "content/renderer/mhtml_generator.h" | 81 #include "content/renderer/mhtml_generator.h" |
80 #include "content/renderer/mouse_lock_dispatcher.h" | 82 #include "content/renderer/mouse_lock_dispatcher.h" |
81 #include "content/renderer/notification_provider.h" | 83 #include "content/renderer/notification_provider.h" |
82 #include "content/renderer/p2p/socket_dispatcher.h" | 84 #include "content/renderer/p2p/socket_dispatcher.h" |
83 #include "content/renderer/plugin_channel_host.h" | 85 #include "content/renderer/plugin_channel_host.h" |
84 #include "content/renderer/browser_plugin/browser_plugin.h" | |
85 #include "content/renderer/browser_plugin/browser_plugin_constants.h" | |
86 #include "content/renderer/render_process.h" | 86 #include "content/renderer/render_process.h" |
87 #include "content/renderer/render_thread_impl.h" | 87 #include "content/renderer/render_thread_impl.h" |
88 #include "content/renderer/render_widget_fullscreen_pepper.h" | 88 #include "content/renderer/render_widget_fullscreen_pepper.h" |
89 #include "content/renderer/renderer_accessibility.h" | 89 #include "content/renderer/renderer_accessibility.h" |
90 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 90 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
91 #include "content/renderer/renderer_webcolorchooser_impl.h" | 91 #include "content/renderer/renderer_webcolorchooser_impl.h" |
92 #include "content/renderer/speech_recognition_dispatcher.h" | 92 #include "content/renderer/speech_recognition_dispatcher.h" |
93 #include "content/renderer/text_input_client_observer.h" | 93 #include "content/renderer/text_input_client_observer.h" |
94 #include "content/renderer/v8_value_converter_impl.h" | 94 #include "content/renderer/v8_value_converter_impl.h" |
95 #include "content/renderer/web_intents_host.h" | 95 #include "content/renderer/web_intents_host.h" |
96 #include "content/renderer/web_ui_bindings.h" | 96 #include "content/renderer/web_ui_bindings.h" |
97 #include "content/renderer/webplugin_delegate_proxy.h" | 97 #include "content/renderer/webplugin_delegate_proxy.h" |
98 #include "content/renderer/websharedworker_proxy.h" | 98 #include "content/renderer/websharedworker_proxy.h" |
99 #include "media/base/filter_collection.h" | 99 #include "media/base/filter_collection.h" |
100 #include "media/base/media_switches.h" | 100 #include "media/base/media_switches.h" |
101 #include "media/base/message_loop_factory.h" | 101 #include "media/base/message_loop_factory.h" |
102 #include "media/filters/audio_renderer_impl.h" | 102 #include "media/filters/audio_renderer_impl.h" |
103 #include "media/filters/gpu_video_decoder.h" | 103 #include "media/filters/gpu_video_decoder.h" |
104 #include "net/base/escape.h" | 104 #include "net/base/escape.h" |
105 #include "net/base/net_errors.h" | 105 #include "net/base/net_errors.h" |
106 #include "net/http/http_util.h" | 106 #include "net/http/http_util.h" |
107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
| 108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" |
| 109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" |
108 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
109 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
110 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMEvent.h" | |
111 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMMessageEvent.h" | |
112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 112 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" | 113 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" |
114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 114 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" | 115 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" |
116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement
.h" | 116 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement
.h" |
117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 117 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 118 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" | 119 #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 121 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | 154 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
155 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 155 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
156 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" | 156 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" |
157 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 157 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
158 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 158 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
159 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" | 159 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
160 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 160 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
161 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon
se.h" | 161 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon
se.h" |
162 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 162 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
163 #include "third_party/skia/include/core/SkBitmap.h" | 163 #include "third_party/skia/include/core/SkBitmap.h" |
164 #include "ui/base/javascript_message_type.h" | |
165 #include "ui/gfx/native_widget_types.h" | 164 #include "ui/gfx/native_widget_types.h" |
166 #include "ui/gfx/point.h" | 165 #include "ui/gfx/point.h" |
167 #include "ui/gfx/rect.h" | 166 #include "ui/gfx/rect.h" |
168 #include "v8/include/v8.h" | 167 #include "v8/include/v8.h" |
169 #include "webkit/appcache/web_application_cache_host_impl.h" | 168 #include "webkit/appcache/web_application_cache_host_impl.h" |
170 #include "webkit/dom_storage/dom_storage_types.h" | 169 #include "webkit/dom_storage/dom_storage_types.h" |
171 #include "webkit/forms/form_data.h" | 170 #include "webkit/forms/form_data.h" |
172 #include "webkit/forms/form_field.h" | 171 #include "webkit/forms/form_field.h" |
173 #include "webkit/forms/password_form_dom_manager.h" | 172 #include "webkit/forms/password_form_dom_manager.h" |
174 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 173 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 failed_request, error, &alt_html, NULL); | 1545 failed_request, error, &alt_html, NULL); |
1547 error_html = &alt_html; | 1546 error_html = &alt_html; |
1548 } | 1547 } |
1549 | 1548 |
1550 frame->loadHTMLString(*error_html, | 1549 frame->loadHTMLString(*error_html, |
1551 GURL(content::kUnreachableWebDataURL), | 1550 GURL(content::kUnreachableWebDataURL), |
1552 error.unreachableURL, | 1551 error.unreachableURL, |
1553 replace); | 1552 replace); |
1554 } | 1553 } |
1555 | 1554 |
1556 bool RenderViewImpl::RunJavaScriptMessage(ui::JavascriptMessageType type, | 1555 bool RenderViewImpl::RunJavaScriptMessage(content::JavaScriptMessageType type, |
1557 const string16& message, | 1556 const string16& message, |
1558 const string16& default_value, | 1557 const string16& default_value, |
1559 const GURL& frame_url, | 1558 const GURL& frame_url, |
1560 string16* result) { | 1559 string16* result) { |
1561 bool success = false; | 1560 bool success = false; |
1562 string16 result_temp; | 1561 string16 result_temp; |
1563 if (!result) | 1562 if (!result) |
1564 result = &result_temp; | 1563 result = &result_temp; |
1565 | 1564 |
1566 SendAndRunNestedMessageLoop(new ViewHostMsg_RunJavaScriptMessage( | 1565 SendAndRunNestedMessageLoop(new ViewHostMsg_RunJavaScriptMessage( |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 webkit_glue::WebStringToFilePath(params.initialValue); | 1909 webkit_glue::WebStringToFilePath(params.initialValue); |
1911 ipc_params.accept_types.reserve(params.acceptMIMETypes.size()); | 1910 ipc_params.accept_types.reserve(params.acceptMIMETypes.size()); |
1912 for (size_t i = 0; i < params.acceptMIMETypes.size(); ++i) | 1911 for (size_t i = 0; i < params.acceptMIMETypes.size(); ++i) |
1913 ipc_params.accept_types.push_back(params.acceptMIMETypes[i]); | 1912 ipc_params.accept_types.push_back(params.acceptMIMETypes[i]); |
1914 | 1913 |
1915 return ScheduleFileChooser(ipc_params, chooser_completion); | 1914 return ScheduleFileChooser(ipc_params, chooser_completion); |
1916 } | 1915 } |
1917 | 1916 |
1918 void RenderViewImpl::runModalAlertDialog(WebFrame* frame, | 1917 void RenderViewImpl::runModalAlertDialog(WebFrame* frame, |
1919 const WebString& message) { | 1918 const WebString& message) { |
1920 RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_ALERT, | 1919 RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_ALERT, |
1921 message, | 1920 message, |
1922 string16(), | 1921 string16(), |
1923 frame->document().url(), | 1922 frame->document().url(), |
1924 NULL); | 1923 NULL); |
1925 } | 1924 } |
1926 | 1925 |
1927 bool RenderViewImpl::runModalConfirmDialog(WebFrame* frame, | 1926 bool RenderViewImpl::runModalConfirmDialog(WebFrame* frame, |
1928 const WebString& message) { | 1927 const WebString& message) { |
1929 return RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, | 1928 return RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_CONFIRM, |
1930 message, | 1929 message, |
1931 string16(), | 1930 string16(), |
1932 frame->document().url(), | 1931 frame->document().url(), |
1933 NULL); | 1932 NULL); |
1934 } | 1933 } |
1935 | 1934 |
1936 bool RenderViewImpl::runModalPromptDialog(WebFrame* frame, | 1935 bool RenderViewImpl::runModalPromptDialog(WebFrame* frame, |
1937 const WebString& message, | 1936 const WebString& message, |
1938 const WebString& default_value, | 1937 const WebString& default_value, |
1939 WebString* actual_value) { | 1938 WebString* actual_value) { |
1940 string16 result; | 1939 string16 result; |
1941 bool ok = RunJavaScriptMessage(ui::JAVASCRIPT_MESSAGE_TYPE_PROMPT, | 1940 bool ok = RunJavaScriptMessage(content::JAVASCRIPT_MESSAGE_TYPE_PROMPT, |
1942 message, | 1941 message, |
1943 default_value, | 1942 default_value, |
1944 frame->document().url(), | 1943 frame->document().url(), |
1945 &result); | 1944 &result); |
1946 if (ok) | 1945 if (ok) |
1947 actual_value->assign(result); | 1946 actual_value->assign(result); |
1948 return ok; | 1947 return ok; |
1949 } | 1948 } |
1950 | 1949 |
1951 bool RenderViewImpl::runModalBeforeUnloadDialog( | 1950 bool RenderViewImpl::runModalBeforeUnloadDialog( |
(...skipping 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5515 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5514 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5516 return !!RenderThreadImpl::current()->compositor_thread(); | 5515 return !!RenderThreadImpl::current()->compositor_thread(); |
5517 } | 5516 } |
5518 | 5517 |
5519 void RenderViewImpl::OnJavaBridgeInit() { | 5518 void RenderViewImpl::OnJavaBridgeInit() { |
5520 DCHECK(!java_bridge_dispatcher_); | 5519 DCHECK(!java_bridge_dispatcher_); |
5521 #if defined(ENABLE_JAVA_BRIDGE) | 5520 #if defined(ENABLE_JAVA_BRIDGE) |
5522 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5521 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5523 #endif | 5522 #endif |
5524 } | 5523 } |
OLD | NEW |