| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 void Finalize(); | 187 void Finalize(); |
| 188 | 188 |
| 189 // Registers the preferences that we store registered protocol handlers in. | 189 // Registers the preferences that we store registered protocol handlers in. |
| 190 static void RegisterPrefs(PrefService* prefService); | 190 static void RegisterPrefs(PrefService* prefService); |
| 191 | 191 |
| 192 bool enabled() const { return enabled_; } | 192 bool enabled() const { return enabled_; } |
| 193 | 193 |
| 194 private: | 194 private: |
| 195 friend class base::RefCountedThreadSafe<ProtocolHandlerRegistry>; | 195 friend class base::RefCountedThreadSafe<ProtocolHandlerRegistry>; |
| 196 | 196 |
| 197 // Install the default handlers. |
| 198 void InstallFixedHandlers(); |
| 199 |
| 197 // Puts the given handler at the top of the list of handlers for its | 200 // Puts the given handler at the top of the list of handlers for its |
| 198 // protocol. | 201 // protocol. |
| 199 void PromoteHandler(const ProtocolHandler& handler); | 202 void PromoteHandler(const ProtocolHandler& handler); |
| 200 | 203 |
| 201 // Clears the default for the provided protocol. | 204 // Clears the default for the provided protocol. |
| 202 // Should be called only from the IO thread. | 205 // Should be called only from the IO thread. |
| 203 void ClearDefaultIO(const std::string& scheme); | 206 void ClearDefaultIO(const std::string& scheme); |
| 204 | 207 |
| 205 // Makes this ProtocolHandler the default handler for its protocol. | 208 // Makes this ProtocolHandler the default handler for its protocol. |
| 206 // Should be called only from the IO thread. | 209 // Should be called only from the IO thread. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 284 |
| 282 // Copy of default_handlers_ that is only accessed on the IO thread. | 285 // Copy of default_handlers_ that is only accessed on the IO thread. |
| 283 ProtocolHandlerMap default_handlers_io_; | 286 ProtocolHandlerMap default_handlers_io_; |
| 284 | 287 |
| 285 friend class ProtocolHandlerRegistryTest; | 288 friend class ProtocolHandlerRegistryTest; |
| 286 friend class RegisterProtocolHandlerBrowserTest; | 289 friend class RegisterProtocolHandlerBrowserTest; |
| 287 | 290 |
| 288 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 291 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
| 289 }; | 292 }; |
| 290 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 293 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
| OLD | NEW |