| 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_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // guarantee that the app successfully handled it. | 100 // guarantee that the app successfully handled it. |
| 101 virtual bool HandleExternalProtocol(const GURL& url, | 101 virtual bool HandleExternalProtocol(const GURL& url, |
| 102 int child_id, | 102 int child_id, |
| 103 int route_id); | 103 int route_id); |
| 104 | 104 |
| 105 // Returns true if we should force the given resource to be downloaded. | 105 // Returns true if we should force the given resource to be downloaded. |
| 106 // Otherwise, the content layer decides. | 106 // Otherwise, the content layer decides. |
| 107 virtual bool ShouldForceDownloadResource( | 107 virtual bool ShouldForceDownloadResource( |
| 108 const GURL& url, const std::string& mime_type); | 108 const GURL& url, const std::string& mime_type); |
| 109 | 109 |
| 110 // Returns true and sets security origin if a Stream should be created for |
| 111 // the resource. |
| 112 virtual bool ShouldCreateStream(content::ResourceContext* resource_context, |
| 113 const GURL& url, |
| 114 const std::string& mime_type, |
| 115 GURL* security_origin); |
| 116 |
| 117 // Informs the delegate that a stream was created. |
| 118 virtual void OnStreamCreated( |
| 119 content::ResourceContext* resource_context, |
| 120 int render_process_id, |
| 121 int render_view_id, |
| 122 const GURL& stream_url, |
| 123 const std::string& mime_type, |
| 124 const GURL& original_url); |
| 125 |
| 110 // Informs the delegate that a response has started. | 126 // Informs the delegate that a response has started. |
| 111 virtual void OnResponseStarted( | 127 virtual void OnResponseStarted( |
| 112 net::URLRequest* request, | 128 net::URLRequest* request, |
| 113 ResourceContext* resource_context, | 129 ResourceContext* resource_context, |
| 114 ResourceResponse* response, | 130 ResourceResponse* response, |
| 115 IPC::Sender* sender); | 131 IPC::Sender* sender); |
| 116 | 132 |
| 117 // Informs the delegate that a request has been redirected. | 133 // Informs the delegate that a request has been redirected. |
| 118 virtual void OnRequestRedirected( | 134 virtual void OnRequestRedirected( |
| 119 const GURL& redirect_url, | 135 const GURL& redirect_url, |
| 120 net::URLRequest* request, | 136 net::URLRequest* request, |
| 121 ResourceContext* resource_context, | 137 ResourceContext* resource_context, |
| 122 ResourceResponse* response); | 138 ResourceResponse* response); |
| 123 | 139 |
| 124 protected: | 140 protected: |
| 125 ResourceDispatcherHostDelegate(); | 141 ResourceDispatcherHostDelegate(); |
| 126 virtual ~ResourceDispatcherHostDelegate(); | 142 virtual ~ResourceDispatcherHostDelegate(); |
| 127 }; | 143 }; |
| 128 | 144 |
| 129 } // namespace content | 145 } // namespace content |
| 130 | 146 |
| 131 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 147 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| OLD | NEW |