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

Unified Diff: chrome/browser/android/offline_pages/offline_page_request_interceptor.h

Issue 2388253002: Use the previews black list for offline previews (Closed)
Patch Set: jianli comment 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/offline_page_request_interceptor.h
diff --git a/chrome/browser/android/offline_pages/offline_page_request_interceptor.h b/chrome/browser/android/offline_pages/offline_page_request_interceptor.h
index 0c94b9a7fbb9541a21b701185ad76aec6d6a24cf..0d26ec2436c80d744b03242dba43728257f3af1b 100644
--- a/chrome/browser/android/offline_pages/offline_page_request_interceptor.h
+++ b/chrome/browser/android/offline_pages/offline_page_request_interceptor.h
@@ -1,37 +1,46 @@
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_
#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "net/url_request/url_request_interceptor.h"
namespace net {
class NetworkDelegate;
class URLRequest;
class URLRequestJob;
}
+namespace previews {
+class PreviewsDecider;
+}
+
namespace offline_pages {
// An interceptor to hijack requests and potentially service them based on
// their offline information. Created one per profile.
class OfflinePageRequestInterceptor : public net::URLRequestInterceptor {
public:
- OfflinePageRequestInterceptor();
+ explicit OfflinePageRequestInterceptor(
+ base::WeakPtr<previews::PreviewsDecider> previews_decider);
~OfflinePageRequestInterceptor() override;
private:
// Overrides from net::URLRequestInterceptor:
net::URLRequestJob* MaybeInterceptRequest(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
+ // Used to determine if an URLRequest is eligible for offline previews.
+ base::WeakPtr<previews::PreviewsDecider> previews_decider_;
+
DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestInterceptor);
};
} // namespace offline_pages
#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_REQUEST_INTERCEPTOR_H_

Powered by Google App Engine
This is Rietveld 408576698