OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_FA
CTORY_H_ | 4 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_FA
CTORY_H_ |
5 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_FA
CTORY_H_ | 5 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_FA
CTORY_H_ |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
10 #include "extensions/browser/api/networking_private/networking_private_delegate.
h" | 10 #include "extensions/browser/api/networking_private/networking_private_delegate.
h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // Provide optional factories for creating delegate instances. | 56 // Provide optional factories for creating delegate instances. |
57 void SetVerifyDelegateFactory(scoped_ptr<VerifyDelegateFactory> factory); | 57 void SetVerifyDelegateFactory(scoped_ptr<VerifyDelegateFactory> factory); |
58 void SetUIDelegateFactory(scoped_ptr<UIDelegateFactory> factory); | 58 void SetUIDelegateFactory(scoped_ptr<UIDelegateFactory> factory); |
59 | 59 |
60 static NetworkingPrivateDelegate* GetForBrowserContext( | 60 static NetworkingPrivateDelegate* GetForBrowserContext( |
61 content::BrowserContext* browser_context); | 61 content::BrowserContext* browser_context); |
62 static NetworkingPrivateDelegateFactory* GetInstance(); | 62 static NetworkingPrivateDelegateFactory* GetInstance(); |
63 | 63 |
64 private: | 64 private: |
65 friend struct DefaultSingletonTraits<NetworkingPrivateDelegateFactory>; | 65 friend struct base::DefaultSingletonTraits<NetworkingPrivateDelegateFactory>; |
66 | 66 |
67 NetworkingPrivateDelegateFactory(); | 67 NetworkingPrivateDelegateFactory(); |
68 ~NetworkingPrivateDelegateFactory() override; | 68 ~NetworkingPrivateDelegateFactory() override; |
69 | 69 |
70 // BrowserContextKeyedServiceFactory: | 70 // BrowserContextKeyedServiceFactory: |
71 KeyedService* BuildServiceInstanceFor( | 71 KeyedService* BuildServiceInstanceFor( |
72 content::BrowserContext* browser_context) const override; | 72 content::BrowserContext* browser_context) const override; |
73 content::BrowserContext* GetBrowserContextToUse( | 73 content::BrowserContext* GetBrowserContextToUse( |
74 content::BrowserContext* context) const override; | 74 content::BrowserContext* context) const override; |
75 bool ServiceIsCreatedWithBrowserContext() const override; | 75 bool ServiceIsCreatedWithBrowserContext() const override; |
76 bool ServiceIsNULLWhileTesting() const override; | 76 bool ServiceIsNULLWhileTesting() const override; |
77 | 77 |
78 scoped_ptr<VerifyDelegateFactory> verify_factory_; | 78 scoped_ptr<VerifyDelegateFactory> verify_factory_; |
79 scoped_ptr<UIDelegateFactory> ui_factory_; | 79 scoped_ptr<UIDelegateFactory> ui_factory_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegateFactory); | 81 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegateFactory); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace extensions | 84 } // namespace extensions |
85 | 85 |
86 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_FACTORY_H_ | 86 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_FACTORY_H_ |
OLD | NEW |