| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // |Delegate| provides an interface for interacting asynchronously | 43 // |Delegate| provides an interface for interacting asynchronously |
| 44 // with the underlying OS for the purposes of registering Chrome | 44 // with the underlying OS for the purposes of registering Chrome |
| 45 // as the default handler for specific protocols. | 45 // as the default handler for specific protocols. |
| 46 class Delegate { | 46 class Delegate { |
| 47 public: | 47 public: |
| 48 virtual ~Delegate(); | 48 virtual ~Delegate(); |
| 49 virtual void RegisterExternalHandler(const std::string& protocol); | 49 virtual void RegisterExternalHandler(const std::string& protocol); |
| 50 virtual void DeregisterExternalHandler(const std::string& protocol); | 50 virtual void DeregisterExternalHandler(const std::string& protocol); |
| 51 virtual bool IsExternalHandlerRegistered(const std::string& protocol); | 51 virtual bool IsExternalHandlerRegistered(const std::string& protocol); |
| 52 virtual scoped_refptr<shell_integration::DefaultProtocolClientWorker> | |
| 53 CreateShellWorker( | |
| 54 const shell_integration::DefaultWebClientWorkerCallback& callback, | |
| 55 const std::string& protocol); | |
| 56 virtual void RegisterWithOSAsDefaultClient( | 52 virtual void RegisterWithOSAsDefaultClient( |
| 57 const std::string& protocol, | 53 const std::string& protocol, |
| 58 ProtocolHandlerRegistry* registry); | 54 ProtocolHandlerRegistry* registry); |
| 59 }; | 55 }; |
| 60 | 56 |
| 61 // Forward declaration of the internal implementation class. | 57 // Forward declaration of the internal implementation class. |
| 62 class IOThreadDelegate; | 58 class IOThreadDelegate; |
| 63 | 59 |
| 64 // JobInterceptorFactory intercepts URLRequestJob creation for URLRequests the | 60 // JobInterceptorFactory intercepts URLRequestJob creation for URLRequests the |
| 65 // ProtocolHandlerRegistry is registered to handle. When no handler is | 61 // ProtocolHandlerRegistry is registered to handle. When no handler is |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // are posted to the IO thread where updates are applied to this object. | 359 // are posted to the IO thread where updates are applied to this object. |
| 364 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 360 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
| 365 | 361 |
| 366 // Makes it possible to invalidate the callback for the | 362 // Makes it possible to invalidate the callback for the |
| 367 // DefaultProtocolClientWorker. | 363 // DefaultProtocolClientWorker. |
| 368 base::WeakPtrFactory<ProtocolHandlerRegistry> weak_ptr_factory_; | 364 base::WeakPtrFactory<ProtocolHandlerRegistry> weak_ptr_factory_; |
| 369 | 365 |
| 370 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 366 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
| 371 }; | 367 }; |
| 372 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 368 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| OLD | NEW |