| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| 22 #include "net/url_request/url_request_job.h" | 22 #include "net/url_request/url_request_job.h" |
| 23 | 23 |
| 24 // This is where handlers for protocols registered with | 24 // This is where handlers for protocols registered with |
| 25 // navigator.registerProtocolHandler() are registered. Each Profile owns an | 25 // navigator.registerProtocolHandler() are registered. Each Profile owns an |
| 26 // instance of this class, which is initialized on browser start through | 26 // instance of this class, which is initialized on browser start through |
| 27 // Profile::InitRegisteredProtocolHandlers(), and they should be the only | 27 // Profile::InitRegisteredProtocolHandlers(), and they should be the only |
| 28 // instances of this class. | 28 // instances of this class. |
| 29 | 29 |
| 30 class ProtocolHandlerRegistry | 30 class ProtocolHandlerRegistry |
| 31 : public base::RefCountedThreadSafe<ProtocolHandlerRegistry, | 31 : public base::RefCountedThreadSafe< |
| 32 BrowserThread::DeleteOnIOThread> { | 32 ProtocolHandlerRegistry, content::BrowserThread::DeleteOnIOThread> { |
| 33 public: | 33 public: |
| 34 class DefaultClientObserver | 34 class DefaultClientObserver |
| 35 : public ShellIntegration::DefaultWebClientObserver { | 35 : public ShellIntegration::DefaultWebClientObserver { |
| 36 public: | 36 public: |
| 37 explicit DefaultClientObserver(ProtocolHandlerRegistry* registry); | 37 explicit DefaultClientObserver(ProtocolHandlerRegistry* registry); |
| 38 virtual ~DefaultClientObserver(); | 38 virtual ~DefaultClientObserver(); |
| 39 | 39 |
| 40 // Get response from the worker regarding whether Chrome is the default | 40 // Get response from the worker regarding whether Chrome is the default |
| 41 // handler for the protocol. | 41 // handler for the protocol. |
| 42 virtual void SetDefaultWebClientUIState( | 42 virtual void SetDefaultWebClientUIState( |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 DefaultClientObserverList default_client_observers_; | 280 DefaultClientObserverList default_client_observers_; |
| 281 | 281 |
| 282 // Copy of default_handlers_ that is only accessed on the IO thread. | 282 // Copy of default_handlers_ that is only accessed on the IO thread. |
| 283 ProtocolHandlerMap default_handlers_io_; | 283 ProtocolHandlerMap default_handlers_io_; |
| 284 | 284 |
| 285 friend class ProtocolHandlerRegistryTest; | 285 friend class ProtocolHandlerRegistryTest; |
| 286 | 286 |
| 287 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 287 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
| 288 }; | 288 }; |
| 289 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 289 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| OLD | NEW |