| 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 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 using blink::WebData; | 250 using blink::WebData; |
| 251 using blink::WebDataSource; | 251 using blink::WebDataSource; |
| 252 using blink::WebDocument; | 252 using blink::WebDocument; |
| 253 using blink::WebDOMEvent; | 253 using blink::WebDOMEvent; |
| 254 using blink::WebDOMMessageEvent; | 254 using blink::WebDOMMessageEvent; |
| 255 using blink::WebElement; | 255 using blink::WebElement; |
| 256 using blink::WebExternalPopupMenu; | 256 using blink::WebExternalPopupMenu; |
| 257 using blink::WebExternalPopupMenuClient; | 257 using blink::WebExternalPopupMenuClient; |
| 258 using blink::WebFindOptions; | 258 using blink::WebFindOptions; |
| 259 using blink::WebFrame; | 259 using blink::WebFrame; |
| 260 using blink::WebFrameLoadType; |
| 260 using blink::WebFrameSerializer; | 261 using blink::WebFrameSerializer; |
| 261 using blink::WebFrameSerializerClient; | 262 using blink::WebFrameSerializerClient; |
| 262 using blink::WebHistoryItem; | 263 using blink::WebHistoryItem; |
| 263 using blink::WebHTTPBody; | 264 using blink::WebHTTPBody; |
| 264 using blink::WebLocalFrame; | 265 using blink::WebLocalFrame; |
| 265 using blink::WebMediaPlayer; | 266 using blink::WebMediaPlayer; |
| 266 using blink::WebMediaPlayerClient; | 267 using blink::WebMediaPlayerClient; |
| 267 using blink::WebMediaPlayerEncryptedMediaClient; | 268 using blink::WebMediaPlayerEncryptedMediaClient; |
| 268 using blink::WebMediaSession; | 269 using blink::WebMediaSession; |
| 269 using blink::WebNavigationPolicy; | 270 using blink::WebNavigationPolicy; |
| (...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 | 2097 |
| 2097 WebDOMMessageEvent msg_event(serialized_script_value, | 2098 WebDOMMessageEvent msg_event(serialized_script_value, |
| 2098 params.source_origin, | 2099 params.source_origin, |
| 2099 source_frame, | 2100 source_frame, |
| 2100 frame_->document(), | 2101 frame_->document(), |
| 2101 channels); | 2102 channels); |
| 2102 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event); | 2103 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event); |
| 2103 } | 2104 } |
| 2104 | 2105 |
| 2105 void RenderFrameImpl::OnReload(bool ignore_cache) { | 2106 void RenderFrameImpl::OnReload(bool ignore_cache) { |
| 2106 frame_->reload(ignore_cache); | 2107 // TODO(crbug.com/599364): Rename |ignore_cache| or change it to enum. |
| 2108 // Eventually we may remove FrameMsg_Reload, and use FrameMsg_Navigate. |
| 2109 frame_->reload(ignore_cache ? WebFrameLoadType::ReloadBypassingCache |
| 2110 : WebFrameLoadType::Reload); |
| 2107 } | 2111 } |
| 2108 | 2112 |
| 2109 void RenderFrameImpl::OnReloadLoFiImages() { | 2113 void RenderFrameImpl::OnReloadLoFiImages() { |
| 2110 is_using_lofi_ = false; | 2114 is_using_lofi_ = false; |
| 2111 GetWebFrame()->reloadLoFiImages(); | 2115 GetWebFrame()->reloadLoFiImages(); |
| 2112 } | 2116 } |
| 2113 | 2117 |
| 2114 void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) { | 2118 void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) { |
| 2115 blink::WebSurroundingText surroundingText; | 2119 blink::WebSurroundingText surroundingText; |
| 2116 surroundingText.initialize(frame_->selectionRange(), max_length); | 2120 surroundingText.initialize(frame_->selectionRange(), max_length); |
| (...skipping 3183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5300 if (browser_side_navigation) | 5304 if (browser_side_navigation) |
| 5301 request.setCheckForBrowserSideNavigation(false); | 5305 request.setCheckForBrowserSideNavigation(false); |
| 5302 | 5306 |
| 5303 // If we are reloading, then use the history state of the current frame. | 5307 // If we are reloading, then use the history state of the current frame. |
| 5304 // Otherwise, if we have history state, then we need to navigate to it, which | 5308 // Otherwise, if we have history state, then we need to navigate to it, which |
| 5305 // corresponds to a back/forward navigation event. Update the parameters | 5309 // corresponds to a back/forward navigation event. Update the parameters |
| 5306 // depending on the navigation type. | 5310 // depending on the navigation type. |
| 5307 if (is_reload) { | 5311 if (is_reload) { |
| 5308 bool ignore_cache = (common_params.navigation_type == | 5312 bool ignore_cache = (common_params.navigation_type == |
| 5309 FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE); | 5313 FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE); |
| 5310 load_type = ignore_cache ? blink::WebFrameLoadType::ReloadBypassingCache | 5314 load_type = ignore_cache ? WebFrameLoadType::ReloadBypassingCache |
| 5311 : blink::WebFrameLoadType::Reload; | 5315 : WebFrameLoadType::Reload; |
| 5312 | 5316 |
| 5313 if (!browser_side_navigation) { | 5317 if (!browser_side_navigation) { |
| 5314 const GURL override_url = | 5318 const GURL override_url = |
| 5315 (common_params.navigation_type == | 5319 (common_params.navigation_type == |
| 5316 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) | 5320 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) |
| 5317 ? common_params.url | 5321 ? common_params.url |
| 5318 : GURL(); | 5322 : GURL(); |
| 5319 request = frame_->requestForReload(load_type, override_url); | 5323 request = frame_->requestForReload(load_type, override_url); |
| 5320 } | 5324 } |
| 5321 should_load_request = true; | 5325 should_load_request = true; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5675 data_url = GURL(request_params.data_url_as_string); | 5679 data_url = GURL(request_params.data_url_as_string); |
| 5676 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { | 5680 if (!data_url.is_valid() || !data_url.SchemeIs(url::kDataScheme)) { |
| 5677 data_url = params.url; | 5681 data_url = params.url; |
| 5678 } | 5682 } |
| 5679 } | 5683 } |
| 5680 #endif | 5684 #endif |
| 5681 std::string mime_type, charset, data; | 5685 std::string mime_type, charset, data; |
| 5682 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { | 5686 if (net::DataURL::Parse(data_url, &mime_type, &charset, &data)) { |
| 5683 const GURL base_url = params.base_url_for_data_url.is_empty() ? | 5687 const GURL base_url = params.base_url_for_data_url.is_empty() ? |
| 5684 params.url : params.base_url_for_data_url; | 5688 params.url : params.base_url_for_data_url; |
| 5685 bool replace = load_type == blink::WebFrameLoadType::ReloadBypassingCache || | 5689 bool replace = load_type == WebFrameLoadType::ReloadBypassingCache || |
| 5686 load_type == blink::WebFrameLoadType::Reload; | 5690 load_type == WebFrameLoadType::Reload; |
| 5687 | 5691 |
| 5688 frame->loadData( | 5692 frame->loadData( |
| 5689 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), | 5693 WebData(data.c_str(), data.length()), WebString::fromUTF8(mime_type), |
| 5690 WebString::fromUTF8(charset), base_url, | 5694 WebString::fromUTF8(charset), base_url, |
| 5691 // Needed so that history-url-only changes don't become reloads. | 5695 // Needed so that history-url-only changes don't become reloads. |
| 5692 params.history_url_for_data_url, replace, load_type, | 5696 params.history_url_for_data_url, replace, load_type, |
| 5693 item_for_history_navigation, history_load_type, is_client_redirect); | 5697 item_for_history_navigation, history_load_type, is_client_redirect); |
| 5694 } else { | 5698 } else { |
| 5695 CHECK(false) << "Invalid URL passed: " | 5699 CHECK(false) << "Invalid URL passed: " |
| 5696 << params.url.possibly_invalid_spec(); | 5700 << params.url.possibly_invalid_spec(); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6032 int match_count, | 6036 int match_count, |
| 6033 int ordinal, | 6037 int ordinal, |
| 6034 const WebRect& selection_rect, | 6038 const WebRect& selection_rect, |
| 6035 bool final_status_update) { | 6039 bool final_status_update) { |
| 6036 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6040 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6037 selection_rect, ordinal, | 6041 selection_rect, ordinal, |
| 6038 final_status_update)); | 6042 final_status_update)); |
| 6039 } | 6043 } |
| 6040 | 6044 |
| 6041 } // namespace content | 6045 } // namespace content |
| OLD | NEW |