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 CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
6 #define CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 6 #define CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Returns a net::URLRequestJobFactory suitable for use on the IO thread, but | 139 // Returns a net::URLRequestJobFactory suitable for use on the IO thread, but |
140 // is initialized on the UI thread. | 140 // is initialized on the UI thread. |
141 scoped_ptr<JobInterceptorFactory> CreateJobInterceptorFactory(); | 141 scoped_ptr<JobInterceptorFactory> CreateJobInterceptorFactory(); |
142 | 142 |
143 // Called when a site tries to register as a protocol handler. If the request | 143 // Called when a site tries to register as a protocol handler. If the request |
144 // can be handled silently by the registry - either to ignore the request | 144 // can be handled silently by the registry - either to ignore the request |
145 // or to update an existing handler - the request will succeed. If this | 145 // or to update an existing handler - the request will succeed. If this |
146 // function returns false the user needs to be prompted for confirmation. | 146 // function returns false the user needs to be prompted for confirmation. |
147 bool SilentlyHandleRegisterHandlerRequest(const ProtocolHandler& handler); | 147 bool SilentlyHandleRegisterHandlerRequest(const ProtocolHandler& handler); |
148 | 148 |
| 149 // Display the UI request for the site's permission to register a protocol |
| 150 // handler. |
| 151 void RequestPermission(content::WebContents* web_contents, |
| 152 const ProtocolHandler& handler); |
| 153 |
149 // Called when the user accepts the registration of a given protocol handler. | 154 // Called when the user accepts the registration of a given protocol handler. |
150 void OnAcceptRegisterProtocolHandler(const ProtocolHandler& handler); | 155 void OnAcceptRegisterProtocolHandler(const ProtocolHandler& handler); |
151 | 156 |
152 // Called when the user denies the registration of a given protocol handler. | 157 // Called when the user denies the registration of a given protocol handler. |
153 void OnDenyRegisterProtocolHandler(const ProtocolHandler& handler); | 158 void OnDenyRegisterProtocolHandler(const ProtocolHandler& handler); |
154 | 159 |
155 // Called when the user indicates that they don't want to be asked about the | 160 // Called when the user indicates that they don't want to be asked about the |
156 // given protocol handler again. | 161 // given protocol handler again. |
157 void OnIgnoreRegisterProtocolHandler(const ProtocolHandler& handler); | 162 void OnIgnoreRegisterProtocolHandler(const ProtocolHandler& handler); |
158 | 163 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 330 |
326 // Copy of registry data for use on the IO thread. Changes to the registry | 331 // Copy of registry data for use on the IO thread. Changes to the registry |
327 // are posted to the IO thread where updates are applied to this object. | 332 // are posted to the IO thread where updates are applied to this object. |
328 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 333 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
329 | 334 |
330 DefaultClientObserverList default_client_observers_; | 335 DefaultClientObserverList default_client_observers_; |
331 | 336 |
332 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 337 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
333 }; | 338 }; |
334 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 339 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
OLD | NEW |