1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_ANDROID_INTERCEPT_DOWNLOAD_RESOURCE_THROTTLE_H_
6 #define CHROME_BROWSER_ANDROID_INTERCEPT_DOWNLOAD_RESOURCE_THROTTLE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/resource_throttle.h"
18 // InterceptDownloadResourceThrottle checks if a download request should be
19 // handled by Chrome or passsed to the Android Download Manager.
20 class InterceptDownloadResourceThrottle
: public content::ResourceThrottle
{
22 InterceptDownloadResourceThrottle(net::URLRequest
* request
,
23 int render_process_id
,
27 // content::ResourceThrottle implementation:
28 virtual void WillStartRequest(bool* defer
) OVERRIDE
;
29 virtual void WillProcessResponse(bool* defer
) OVERRIDE
;
30 virtual const char* GetNameForLogging() const OVERRIDE
;
33 virtual ~InterceptDownloadResourceThrottle();
35 void ProcessDownloadRequest();
36 // Set to true when if we want chrome to handle the download.
37 const net::URLRequest
* request_
;
38 int render_process_id_
;
42 DISALLOW_COPY_AND_ASSIGN(InterceptDownloadResourceThrottle
);
47 #endif // CHROME_BROWSER_ANDROID_INTERCEPT_DOWNLOAD_RESOURCE_THROTTLE_H_