Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_request_interceptor.cc

Issue 2388253002: Use the previews black list for offline previews (Closed)
Patch Set: mmenke comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/android/offline_pages/offline_page_request_interceptor. h" 5 #include "chrome/browser/android/offline_pages/offline_page_request_interceptor. h"
6 6
7 #include "base/supports_user_data.h" 7 #include "base/supports_user_data.h"
8 #include "chrome/browser/android/offline_pages/offline_page_request_job.h" 8 #include "chrome/browser/android/offline_pages/offline_page_request_job.h"
9 #include "components/previews/core/previews_decider.h"
9 10
10 namespace offline_pages { 11 namespace offline_pages {
11 12
12 OfflinePageRequestInterceptor::OfflinePageRequestInterceptor() {} 13 OfflinePageRequestInterceptor::OfflinePageRequestInterceptor(
14 previews::PreviewsDecider* previews_decider)
15 : previews_decider_(previews_decider) {}
13 16
14 OfflinePageRequestInterceptor::~OfflinePageRequestInterceptor() {} 17 OfflinePageRequestInterceptor::~OfflinePageRequestInterceptor() {}
15 18
16 net::URLRequestJob* OfflinePageRequestInterceptor::MaybeInterceptRequest( 19 net::URLRequestJob* OfflinePageRequestInterceptor::MaybeInterceptRequest(
17 net::URLRequest* request, 20 net::URLRequest* request,
18 net::NetworkDelegate* network_delegate) const { 21 net::NetworkDelegate* network_delegate) const {
19 // OfflinePageRequestJob::Create may return a nullptr if the interception 22 // OfflinePageRequestJob::Create may return a nullptr if the interception
20 // is not needed for some sort of requests, like non-main resource request, 23 // is not needed for some sort of requests, like non-main resource request,
21 // non-http request and more. 24 // non-http request and more.
22 return OfflinePageRequestJob::Create(request, network_delegate); 25 return OfflinePageRequestJob::Create(request, network_delegate,
26 previews_decider_);
23 } 27 }
24 28
25 } // namespace offline_pages 29 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698