Chromium Code Reviews| Index: chrome/browser/android/offline_pages/downloads/resource_throttle.h |
| diff --git a/chrome/browser/android/offline_pages/downloads/resource_throttle.h b/chrome/browser/android/offline_pages/downloads/resource_throttle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8be007333467849f9134afc76f8166a03c1adbc5 |
| --- /dev/null |
| +++ b/chrome/browser/android/offline_pages/downloads/resource_throttle.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
asanka
2016/12/07 16:37:40
Nit: copyright header is different now:
https://c
|
| +// 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_DOWNLOADS_RESOURCE_THROTTLE_H_ |
| +#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_RESOURCE_THROTTLE_H_ |
| + |
| +#include "content/public/browser/resource_throttle.h" |
| +#include "net/url_request/url_request.h" |
| + |
| +namespace offline_pages { |
| +namespace downloads { |
| + |
| +// ResourceThrottle is used to determine if a download has text/html mime type |
| +// and should be handled as a full page download rather than a single .html |
| +// file download. |
| +class ResourceThrottle : public content::ResourceThrottle { |
| + public: |
| + explicit ResourceThrottle(const net::URLRequest* request); |
| + ~ResourceThrottle() override; |
| + |
| + // content::ResourceThrottle implementation: |
| + void WillProcessResponse(bool* defer) override; |
| + const char* GetNameForLogging() const override; |
| + |
| + private: |
| + const net::URLRequest* request_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ResourceThrottle); |
| +}; |
| + |
| +} // namespace downloads |
| +} // namespace offline_pages |
| + |
| +#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_RESOURCE_THROTTLE_H_ |