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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ScopedVector<ResourceThrottle>* throttles); | 66 ScopedVector<ResourceThrottle>* throttles); |
67 | 67 |
68 // Creates a ResourceDispatcherHostLoginDelegate that asks the user for a | 68 // Creates a ResourceDispatcherHostLoginDelegate that asks the user for a |
69 // username and password. | 69 // username and password. |
70 virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( | 70 virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( |
71 net::AuthChallengeInfo* auth_info, | 71 net::AuthChallengeInfo* auth_info, |
72 net::URLRequest* request); | 72 net::URLRequest* request); |
73 | 73 |
74 // Launches the url for the given tab. Returns true if an attempt to handle | 74 // Launches the url for the given tab. Returns true if an attempt to handle |
75 // the url was made, e.g. by launching an app. Note that this does not | 75 // the url was made, e.g. by launching an app. Note that this does not |
76 // guarantee that the app successfully handled it. | 76 // guarantee that the app successfully handled it. Parameter |is_whitelisted| |
| 77 // specifies whether |url| matches a whitelist pattern defined by user. In |
| 78 // that case it will process the |url| without asking user permission. |
77 virtual bool HandleExternalProtocol( | 79 virtual bool HandleExternalProtocol( |
78 const GURL& url, | 80 const GURL& url, |
79 int child_id, | 81 int child_id, |
80 const ResourceRequestInfo::WebContentsGetter& web_contents_getter, | 82 const ResourceRequestInfo::WebContentsGetter& web_contents_getter, |
81 bool is_main_frame, | 83 bool is_main_frame, |
82 ui::PageTransition page_transition, | 84 ui::PageTransition page_transition, |
83 bool has_user_gesture); | 85 bool has_user_gesture, |
| 86 bool is_whitelisted); |
84 | 87 |
85 // Returns true if we should force the given resource to be downloaded. | 88 // Returns true if we should force the given resource to be downloaded. |
86 // Otherwise, the content layer decides. | 89 // Otherwise, the content layer decides. |
87 virtual bool ShouldForceDownloadResource(const GURL& url, | 90 virtual bool ShouldForceDownloadResource(const GURL& url, |
88 const std::string& mime_type); | 91 const std::string& mime_type); |
89 | 92 |
90 // Returns true and sets |origin| if a Stream should be created for the | 93 // Returns true and sets |origin| if a Stream should be created for the |
91 // resource. |plugin_path| is the plugin which will be used to handle the | 94 // resource. |plugin_path| is the plugin which will be used to handle the |
92 // request (if the stream will be rendered in a BrowserPlugin). It may be | 95 // request (if the stream will be rendered in a BrowserPlugin). It may be |
93 // empty. If true is returned, a new Stream will be created and | 96 // empty. If true is returned, a new Stream will be created and |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 content::ResourceContext* resource_context); | 134 content::ResourceContext* resource_context); |
132 | 135 |
133 protected: | 136 protected: |
134 ResourceDispatcherHostDelegate(); | 137 ResourceDispatcherHostDelegate(); |
135 virtual ~ResourceDispatcherHostDelegate(); | 138 virtual ~ResourceDispatcherHostDelegate(); |
136 }; | 139 }; |
137 | 140 |
138 } // namespace content | 141 } // namespace content |
139 | 142 |
140 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 143 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
OLD | NEW |