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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
22 #include "content/child/appcache/appcache_dispatcher.h" | 22 #include "content/child/appcache/appcache_dispatcher.h" |
23 #include "content/child/plugin_messages.h" | 23 #include "content/child/plugin_messages.h" |
24 #include "content/child/quota_dispatcher.h" | 24 #include "content/child/quota_dispatcher.h" |
25 #include "content/child/request_extra_data.h" | 25 #include "content/child/request_extra_data.h" |
26 #include "content/child/service_worker/service_worker_network_provider.h" | 26 #include "content/child/service_worker/service_worker_network_provider.h" |
27 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 27 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
28 #include "content/child/web_socket_stream_handle_impl.h" | 28 #include "content/child/web_socket_stream_handle_impl.h" |
29 #include "content/child/webmessageportchannel_impl.h" | 29 #include "content/child/webmessageportchannel_impl.h" |
30 #include "content/child/websocket_bridge.h" | 30 #include "content/child/websocket_bridge.h" |
| 31 #include "content/child/weburlresponse_extradata_impl.h" |
31 #include "content/common/clipboard_messages.h" | 32 #include "content/common/clipboard_messages.h" |
32 #include "content/common/frame_messages.h" | 33 #include "content/common/frame_messages.h" |
33 #include "content/common/input_messages.h" | 34 #include "content/common/input_messages.h" |
34 #include "content/common/service_worker/service_worker_types.h" | 35 #include "content/common/service_worker/service_worker_types.h" |
35 #include "content/common/socket_stream_handle_data.h" | 36 #include "content/common/socket_stream_handle_data.h" |
36 #include "content/common/swapped_out_messages.h" | 37 #include "content/common/swapped_out_messages.h" |
37 #include "content/common/view_messages.h" | 38 #include "content/common/view_messages.h" |
38 #include "content/public/common/bindings_policy.h" | 39 #include "content/public/common/bindings_policy.h" |
39 #include "content/public/common/content_constants.h" | 40 #include "content/public/common/content_constants.h" |
40 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 #include "third_party/WebKit/public/web/WebPlugin.h" | 103 #include "third_party/WebKit/public/web/WebPlugin.h" |
103 #include "third_party/WebKit/public/web/WebPluginParams.h" | 104 #include "third_party/WebKit/public/web/WebPluginParams.h" |
104 #include "third_party/WebKit/public/web/WebRange.h" | 105 #include "third_party/WebKit/public/web/WebRange.h" |
105 #include "third_party/WebKit/public/web/WebScriptSource.h" | 106 #include "third_party/WebKit/public/web/WebScriptSource.h" |
106 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 107 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
107 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 108 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
108 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 109 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
109 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 110 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
110 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 111 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
111 #include "third_party/WebKit/public/web/WebView.h" | 112 #include "third_party/WebKit/public/web/WebView.h" |
112 #include "webkit/child/weburlresponse_extradata_impl.h" | |
113 | 113 |
114 #if defined(ENABLE_PLUGINS) | 114 #if defined(ENABLE_PLUGINS) |
115 #include "content/renderer/npapi/webplugin_impl.h" | 115 #include "content/renderer/npapi/webplugin_impl.h" |
116 #include "content/renderer/pepper/pepper_browser_connection.h" | 116 #include "content/renderer/pepper/pepper_browser_connection.h" |
117 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 117 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
118 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 118 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
119 #include "content/renderer/pepper/plugin_module.h" | 119 #include "content/renderer/pepper/plugin_module.h" |
120 #endif | 120 #endif |
121 | 121 |
122 #if defined(ENABLE_WEBRTC) | 122 #if defined(ENABLE_WEBRTC) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 using blink::WebString; | 164 using blink::WebString; |
165 using blink::WebURL; | 165 using blink::WebURL; |
166 using blink::WebURLError; | 166 using blink::WebURLError; |
167 using blink::WebURLRequest; | 167 using blink::WebURLRequest; |
168 using blink::WebURLResponse; | 168 using blink::WebURLResponse; |
169 using blink::WebUserGestureIndicator; | 169 using blink::WebUserGestureIndicator; |
170 using blink::WebVector; | 170 using blink::WebVector; |
171 using blink::WebView; | 171 using blink::WebView; |
172 using base::Time; | 172 using base::Time; |
173 using base::TimeDelta; | 173 using base::TimeDelta; |
174 using webkit_glue::WebURLResponseExtraDataImpl; | |
175 | 174 |
176 namespace content { | 175 namespace content { |
177 | 176 |
178 namespace { | 177 namespace { |
179 | 178 |
180 const char kDefaultAcceptHeader[] = | 179 const char kDefaultAcceptHeader[] = |
181 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/" | 180 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/" |
182 "*;q=0.8"; | 181 "*;q=0.8"; |
183 const char kAcceptHeader[] = "Accept"; | 182 const char kAcceptHeader[] = "Accept"; |
184 | 183 |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 } | 1341 } |
1343 | 1342 |
1344 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { | 1343 void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) { |
1345 OnJavaScriptExecuteRequest(javascript, 0, false); | 1344 OnJavaScriptExecuteRequest(javascript, 0, false); |
1346 } | 1345 } |
1347 | 1346 |
1348 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { | 1347 ServiceRegistry* RenderFrameImpl::GetServiceRegistry() { |
1349 return &service_registry_; | 1348 return &service_registry_; |
1350 } | 1349 } |
1351 | 1350 |
| 1351 bool RenderFrameImpl::IsFTPDirectoryListing() { |
| 1352 WebURLResponseExtraDataImpl* extra_data = |
| 1353 GetExtraDataFromResponse(frame_->dataSource()->response()); |
| 1354 return extra_data ? extra_data->is_ftp_directory_listing() : false; |
| 1355 } |
| 1356 |
1352 // blink::WebFrameClient implementation ---------------------------------------- | 1357 // blink::WebFrameClient implementation ---------------------------------------- |
1353 | 1358 |
1354 blink::WebPlugin* RenderFrameImpl::createPlugin( | 1359 blink::WebPlugin* RenderFrameImpl::createPlugin( |
1355 blink::WebLocalFrame* frame, | 1360 blink::WebLocalFrame* frame, |
1356 const blink::WebPluginParams& params) { | 1361 const blink::WebPluginParams& params) { |
1357 DCHECK_EQ(frame_, frame); | 1362 DCHECK_EQ(frame_, frame); |
1358 blink::WebPlugin* plugin = NULL; | 1363 blink::WebPlugin* plugin = NULL; |
1359 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1364 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1360 this, frame, params, &plugin)) { | 1365 this, frame, params, &plugin)) { |
1361 return plugin; | 1366 return plugin; |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 // If we are in view source mode, then just let the user see the source of | 2550 // If we are in view source mode, then just let the user see the source of |
2546 // the server's error page. | 2551 // the server's error page. |
2547 if (frame->isViewSourceModeEnabled()) | 2552 if (frame->isViewSourceModeEnabled()) |
2548 return; | 2553 return; |
2549 | 2554 |
2550 DocumentState* document_state = | 2555 DocumentState* document_state = |
2551 DocumentState::FromDataSource(frame->provisionalDataSource()); | 2556 DocumentState::FromDataSource(frame->provisionalDataSource()); |
2552 int http_status_code = response.httpStatusCode(); | 2557 int http_status_code = response.httpStatusCode(); |
2553 | 2558 |
2554 // Record page load flags. | 2559 // Record page load flags. |
2555 WebURLResponseExtraDataImpl* extra_data = | 2560 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); |
2556 GetExtraDataFromResponse(response); | |
2557 if (extra_data) { | 2561 if (extra_data) { |
2558 document_state->set_was_fetched_via_spdy( | 2562 document_state->set_was_fetched_via_spdy( |
2559 extra_data->was_fetched_via_spdy()); | 2563 extra_data->was_fetched_via_spdy()); |
2560 document_state->set_was_npn_negotiated( | 2564 document_state->set_was_npn_negotiated( |
2561 extra_data->was_npn_negotiated()); | 2565 extra_data->was_npn_negotiated()); |
2562 document_state->set_npn_negotiated_protocol( | 2566 document_state->set_npn_negotiated_protocol( |
2563 extra_data->npn_negotiated_protocol()); | 2567 extra_data->npn_negotiated_protocol()); |
2564 document_state->set_was_alternate_protocol_available( | 2568 document_state->set_was_alternate_protocol_available( |
2565 extra_data->was_alternate_protocol_available()); | 2569 extra_data->was_alternate_protocol_available()); |
2566 document_state->set_connection_info( | 2570 document_state->set_connection_info( |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3578 | 3582 |
3579 #if defined(ENABLE_BROWSER_CDMS) | 3583 #if defined(ENABLE_BROWSER_CDMS) |
3580 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3584 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3581 if (!cdm_manager_) | 3585 if (!cdm_manager_) |
3582 cdm_manager_ = new RendererCdmManager(this); | 3586 cdm_manager_ = new RendererCdmManager(this); |
3583 return cdm_manager_; | 3587 return cdm_manager_; |
3584 } | 3588 } |
3585 #endif // defined(ENABLE_BROWSER_CDMS) | 3589 #endif // defined(ENABLE_BROWSER_CDMS) |
3586 | 3590 |
3587 } // namespace content | 3591 } // namespace content |
OLD | NEW |