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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 void InstallDefaultsForChromeOS(); | 270 void InstallDefaultsForChromeOS(); |
271 | 271 |
272 // Makes this ProtocolHandler the default handler for its protocol. | 272 // Makes this ProtocolHandler the default handler for its protocol. |
273 void SetDefault(const ProtocolHandler& handler); | 273 void SetDefault(const ProtocolHandler& handler); |
274 | 274 |
275 // Insert the given ProtocolHandler into the registry. | 275 // Insert the given ProtocolHandler into the registry. |
276 void InsertHandler(const ProtocolHandler& handler); | 276 void InsertHandler(const ProtocolHandler& handler); |
277 | 277 |
278 // Returns a JSON list of protocol handlers. The caller is responsible for | 278 // Returns a JSON list of protocol handlers. The caller is responsible for |
279 // deleting this Value. | 279 // deleting this Value. |
280 Value* EncodeRegisteredHandlers(); | 280 base::Value* EncodeRegisteredHandlers(); |
281 | 281 |
282 // Returns a JSON list of ignored protocol handlers. The caller is | 282 // Returns a JSON list of ignored protocol handlers. The caller is |
283 // responsible for deleting this Value. | 283 // responsible for deleting this Value. |
284 Value* EncodeIgnoredHandlers(); | 284 base::Value* EncodeIgnoredHandlers(); |
285 | 285 |
286 // Sends a notification of the given type to the NotificationService. | 286 // Sends a notification of the given type to the NotificationService. |
287 void NotifyChanged(); | 287 void NotifyChanged(); |
288 | 288 |
289 // Registers a new protocol handler. | 289 // Registers a new protocol handler. |
290 void RegisterProtocolHandler(const ProtocolHandler& handler); | 290 void RegisterProtocolHandler(const ProtocolHandler& handler); |
291 | 291 |
292 // Get the DictionaryValues stored under the given pref name that are valid | 292 // Get the DictionaryValues stored under the given pref name that are valid |
293 // ProtocolHandler values. | 293 // ProtocolHandler values. |
294 std::vector<const DictionaryValue*> GetHandlersFromPref( | 294 std::vector<const base::DictionaryValue*> GetHandlersFromPref( |
295 const char* pref_name) const; | 295 const char* pref_name) const; |
296 | 296 |
297 // Ignores future requests to register the given protocol handler. | 297 // Ignores future requests to register the given protocol handler. |
298 void IgnoreProtocolHandler(const ProtocolHandler& handler); | 298 void IgnoreProtocolHandler(const ProtocolHandler& handler); |
299 | 299 |
300 // Map from protocols (strings) to protocol handlers. | 300 // Map from protocols (strings) to protocol handlers. |
301 ProtocolHandlerMultiMap protocol_handlers_; | 301 ProtocolHandlerMultiMap protocol_handlers_; |
302 | 302 |
303 // Protocol handlers that the user has told us to ignore. | 303 // Protocol handlers that the user has told us to ignore. |
304 ProtocolHandlerList ignored_protocol_handlers_; | 304 ProtocolHandlerList ignored_protocol_handlers_; |
(...skipping 20 matching lines...) Expand all Loading... |
325 | 325 |
326 // Copy of registry data for use on the IO thread. Changes to the registry | 326 // 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. | 327 // are posted to the IO thread where updates are applied to this object. |
328 scoped_refptr<IOThreadDelegate> io_thread_delegate_; | 328 scoped_refptr<IOThreadDelegate> io_thread_delegate_; |
329 | 329 |
330 DefaultClientObserverList default_client_observers_; | 330 DefaultClientObserverList default_client_observers_; |
331 | 331 |
332 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); | 332 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistry); |
333 }; | 333 }; |
334 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ | 334 #endif // CHROME_BROWSER_CUSTOM_HANDLERS_PROTOCOL_HANDLER_REGISTRY_H_ |
OLD | NEW |