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 22 matching lines...) Expand all Loading... |
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( |
43 ShellIntegration::DefaultWebClientUIState state); | 43 ShellIntegration::DefaultWebClientUIState state) OVERRIDE; |
44 | 44 |
45 // Give the observer a handle to the worker, so we can find out the protocol | 45 // Give the observer a handle to the worker, so we can find out the protocol |
46 // when we're called and also tell the worker if we get deleted. | 46 // when we're called and also tell the worker if we get deleted. |
47 void SetWorker(ShellIntegration::DefaultProtocolClientWorker* worker); | 47 void SetWorker(ShellIntegration::DefaultProtocolClientWorker* worker); |
48 | 48 |
49 protected: | 49 protected: |
50 ShellIntegration::DefaultProtocolClientWorker* worker_; | 50 ShellIntegration::DefaultProtocolClientWorker* worker_; |
51 | 51 |
52 private: | 52 private: |
53 virtual bool IsOwnedByWorker() { return true; } | 53 virtual bool IsOwnedByWorker() OVERRIDE { return true; } |
54 // This is a raw pointer, not reference counted, intentionally. In general | 54 // This is a raw pointer, not reference counted, intentionally. In general |
55 // subclasses of DefaultWebClientObserver are not able to be refcounted | 55 // subclasses of DefaultWebClientObserver are not able to be refcounted |
56 // e.g. the browser options page | 56 // e.g. the browser options page |
57 ProtocolHandlerRegistry* registry_; | 57 ProtocolHandlerRegistry* registry_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(DefaultClientObserver); | 59 DISALLOW_COPY_AND_ASSIGN(DefaultClientObserver); |
60 }; | 60 }; |
61 | 61 |
62 // TODO(koz): Refactor this to eliminate the unnecessary virtuals. All that | 62 // TODO(koz): Refactor this to eliminate the unnecessary virtuals. All that |
63 // should be needed is a way to ensure that the list of websafe protocols is | 63 // should be needed is a way to ensure that the list of websafe protocols is |
(...skipping 216 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 |