OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "content/public/browser/download_id.h" | 10 #include "content/public/browser/download_id.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // delegate have a longer lifetime than the ResourceDispatcherHost. | 30 // delegate have a longer lifetime than the ResourceDispatcherHost. |
31 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0; | 31 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0; |
32 | 32 |
33 // Controls whether third-party sub-content can pop-up HTTP basic auth | 33 // Controls whether third-party sub-content can pop-up HTTP basic auth |
34 // dialog boxes. | 34 // dialog boxes. |
35 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0; | 35 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0; |
36 | 36 |
37 // Initiates a download by explicit request of the renderer, e.g. due to | 37 // Initiates a download by explicit request of the renderer, e.g. due to |
38 // alt-clicking a link. If the download is started, |started_callback| will | 38 // alt-clicking a link. If the download is started, |started_callback| will |
39 // be called on the UI thread with the DownloadId; otherwise an error code | 39 // be called on the UI thread with the DownloadId; otherwise an error code |
40 // will be returned. | 40 // will be returned. |is_content_initiated| is used to indicate that |
| 41 // the request was generated from a web page, and hence may not be |
| 42 // as trustworthy as a browser generated request. |
41 virtual net::Error BeginDownload( | 43 virtual net::Error BeginDownload( |
42 scoped_ptr<net::URLRequest> request, | 44 scoped_ptr<net::URLRequest> request, |
| 45 bool is_content_initiated, |
43 ResourceContext* context, | 46 ResourceContext* context, |
44 int child_id, | 47 int child_id, |
45 int route_id, | 48 int route_id, |
46 bool prefer_cache, | 49 bool prefer_cache, |
47 const DownloadSaveInfo& save_info, | 50 const DownloadSaveInfo& save_info, |
48 const DownloadStartedCallback& started_callback) = 0; | 51 const DownloadStartedCallback& started_callback) = 0; |
49 | 52 |
50 // Clears the ResourceDispatcherHostLoginDelegate associated with the request. | 53 // Clears the ResourceDispatcherHostLoginDelegate associated with the request. |
51 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0; | 54 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0; |
52 | 55 |
53 // Marks the request as "parked". This happens if a request is | 56 // Marks the request as "parked". This happens if a request is |
54 // redirected cross-site and needs to be resumed by a new render view. | 57 // redirected cross-site and needs to be resumed by a new render view. |
55 virtual void MarkAsTransferredNavigation(net::URLRequest* request) = 0; | 58 virtual void MarkAsTransferredNavigation(net::URLRequest* request) = 0; |
56 | 59 |
57 protected: | 60 protected: |
58 virtual ~ResourceDispatcherHost() {} | 61 virtual ~ResourceDispatcherHost() {} |
59 }; | 62 }; |
60 | 63 |
61 } // namespace content | 64 } // namespace content |
62 | 65 |
63 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ |
OLD | NEW |