ssl_config_service_manager.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_
6#define CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_
7
8namespace net {
9class SSLConfigService;
10}  // namespace net
11
12class PrefService;
13
14// An interface for creating SSLConfigService objects.
15class SSLConfigServiceManager {
16 public:
17  // Create an instance of the SSLConfigServiceManager. The lifetime of the
18  // PrefService objects must be longer than that of the manager. Get SSL
19  // preferences from local_state object.  The user_prefs may be NULL if this
20  // SSLConfigServiceManager is not associated with a profile.
21  static SSLConfigServiceManager* CreateDefaultManager(
22      PrefService* local_state,
23      PrefService* user_prefs);
24
25  static void RegisterPrefs(PrefService* local_state);
26
27  virtual ~SSLConfigServiceManager() {}
28
29  // Get an SSLConfigService instance.  It may be a new instance or the manager
30  // may return the same instance multiple times.
31  // The caller should hold a reference as long as it needs the instance (eg,
32  // using scoped_refptr.)
33  virtual net::SSLConfigService* Get() = 0;
34};
35
36#endif  // CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_
37