| Index: components/previews/core/previews_io_data.cc
|
| diff --git a/components/previews/core/previews_io_data.cc b/components/previews/core/previews_io_data.cc
|
| index ed9f784d7cbd27e7da14f95ecaa8508f7c0e5cb0..82d17b20ca0b223b5a631688c1940195a14f9d7a 100644
|
| --- a/components/previews/core/previews_io_data.cc
|
| +++ b/components/previews/core/previews_io_data.cc
|
| @@ -15,6 +15,7 @@
|
| #include "components/previews/core/previews_black_list.h"
|
| #include "components/previews/core/previews_opt_out_store.h"
|
| #include "components/previews/core/previews_ui_service.h"
|
| +#include "net/base/load_flags.h"
|
| #include "net/nqe/network_quality_estimator.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_context.h"
|
| @@ -117,6 +118,15 @@ bool PreviewsIOData::ShouldAllowPreview(const net::URLRequest& request,
|
| type);
|
| return false;
|
| }
|
| + // LOAD_VALIDATE_CACHE or LOAD_BYPASS_CACHE mean the user reloaded the page.
|
| + // If this is a query for offline previews, reloads should be disallowed.
|
| + if (type == PreviewsType::OFFLINE &&
|
| + request.load_flags() &
|
| + (net::LOAD_VALIDATE_CACHE | net::LOAD_BYPASS_CACHE)) {
|
| + LogPreviewsEligibilityReason(
|
| + PreviewsEligibilityReason::RELOAD_DISALLOWED_FOR_OFFLINE, type);
|
| + return false;
|
| + }
|
| LogPreviewsEligibilityReason(PreviewsEligibilityReason::ALLOWED, type);
|
| return true;
|
| }
|
|
|