Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index a50204fa953cf6a5cd996c1b04281d4d172c7062..bda727eeb342642be56aba7251a50006140cfd1c 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -80,6 +80,7 @@ |
#include "content/public/common/form_field_data.h" |
#include "content/public/common/isolated_world_ids.h" |
#include "content/public/common/page_state.h" |
+#include "content/public/common/previews_state.h" |
#include "content/public/common/resource_response.h" |
#include "content/public/common/service_manager_connection.h" |
#include "content/public/common/url_constants.h" |
@@ -568,8 +569,7 @@ WebURLRequest CreateURLRequestForNavigation( |
} |
} |
- request.setLoFiState( |
- static_cast<WebURLRequest::LoFiState>(common_params.lofi_state)); |
+ request.setPreviewsState(common_params.previews_state); |
RequestExtraData* extra_data = new RequestExtraData(); |
extra_data->set_stream_override(std::move(stream_override)); |
@@ -651,7 +651,7 @@ CommonNavigationParams MakeCommonNavigationParams( |
info.urlRequest.url(), referrer, extra_data->transition_type(), |
navigation_type, gesture, true, info.replacesCurrentHistoryItem, |
ui_timestamp, report_type, GURL(), GURL(), |
- static_cast<LoFiState>(info.urlRequest.getLoFiState()), |
+ info.urlRequest.getPreviewsState(), |
base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(), |
GetRequestBodyForWebURLRequest(info.urlRequest)); |
} |
@@ -1114,7 +1114,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params) |
accessibility_mode_(AccessibilityModeOff), |
render_accessibility_(NULL), |
media_player_delegate_(NULL), |
- is_using_lofi_(false), |
+ previews_state_(PREVIEWS_UNSPECIFIED), |
effective_connection_type_( |
blink::WebEffectiveConnectionType::TypeUnknown), |
is_pasting_(false), |
@@ -1230,7 +1230,7 @@ void RenderFrameImpl::Initialize() { |
RenderFrameImpl* parent_frame = RenderFrameImpl::FromWebFrame( |
frame_->parent()); |
if (parent_frame) { |
- is_using_lofi_ = parent_frame->IsUsingLoFi(); |
+ previews_state_ = parent_frame->GetPreviewsState(); |
effective_connection_type_ = parent_frame->getEffectiveConnectionType(); |
} |
@@ -2266,7 +2266,7 @@ void RenderFrameImpl::OnReload(bool bypass_cache) { |
} |
void RenderFrameImpl::OnReloadLoFiImages() { |
- is_using_lofi_ = false; |
+ previews_state_ = PREVIEWS_OFF; |
GetWebFrame()->reloadLoFiImages(); |
} |
@@ -2657,8 +2657,8 @@ void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level, |
frame_->addMessageToConsole(wcm); |
} |
-bool RenderFrameImpl::IsUsingLoFi() const { |
- return is_using_lofi_; |
+int RenderFrameImpl::GetPreviewsState() const { |
+ return previews_state_; |
} |
bool RenderFrameImpl::IsPasting() const { |
@@ -3546,11 +3546,12 @@ void RenderFrameImpl::didCommitProvisionalLoad( |
static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
WebURLResponseExtraDataImpl* extra_data = |
GetExtraDataFromResponse(frame->dataSource()->response()); |
- // Only update the Lo-Fi and effective connection type states for new main |
- // frame documents. Subframes inherit from the main frame and should not |
+ // Only update the PreviewsState and effective connection type states for new |
+ // main frame documents. Subframes inherit from the main frame and should not |
// change at commit time. |
if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { |
- is_using_lofi_ = extra_data && extra_data->is_using_lofi(); |
+ previews_state_ = |
+ extra_data ? extra_data->previews_state() : PREVIEWS_OFF; |
if (extra_data) { |
effective_connection_type_ = |
EffectiveConnectionTypeToWebEffectiveConnectionType( |
@@ -4291,13 +4292,13 @@ void RenderFrameImpl::willSendRequest(blink::WebLocalFrame* frame, |
request.setExtraData(extra_data); |
- if (request.getLoFiState() == WebURLRequest::LoFiUnspecified) { |
+ if (request.getPreviewsState() == WebURLRequest::PreviewsUnspecified) { |
if (is_main_frame_ && !navigation_state->request_committed()) { |
- request.setLoFiState(static_cast<WebURLRequest::LoFiState>( |
- navigation_state->common_params().lofi_state)); |
+ request.setPreviewsState( |
+ navigation_state->common_params().previews_state); |
} else { |
- request.setLoFiState( |
- is_using_lofi_ ? WebURLRequest::LoFiOn : WebURLRequest::LoFiOff); |
+ request.setPreviewsState(previews_state_ == 0 ? WebURLRequest::PreviewsOff |
+ : previews_state_); |
} |
} |