| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_FAC
TORY_H_ | 5 #ifndef CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_FAC
TORY_H_ |
| 6 #define CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_FAC
TORY_H_ | 6 #define CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_FAC
TORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.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 | 10 |
| 11 class KeyedService; | 11 class KeyedService; |
| 12 class Profile; | 12 class Profile; |
| 13 class SubresourceFilterProfileContext; |
| 13 | 14 |
| 14 // This class is responsible for instantiating a profile-scoped context for | 15 // This class is responsible for instantiating a profile-scoped context for |
| 15 // subresource filtering. | 16 // subresource filtering. |
| 16 class SubresourceFilterProfileContextFactory | 17 class SubresourceFilterProfileContextFactory |
| 17 : public BrowserContextKeyedServiceFactory { | 18 : public BrowserContextKeyedServiceFactory { |
| 18 public: | 19 public: |
| 19 static void EnsureForProfile(Profile* profile); | 20 static SubresourceFilterProfileContext* GetForProfile(Profile* profile); |
| 20 | 21 |
| 21 static SubresourceFilterProfileContextFactory* GetInstance(); | 22 static SubresourceFilterProfileContextFactory* GetInstance(); |
| 22 | 23 |
| 23 SubresourceFilterProfileContextFactory(); | 24 SubresourceFilterProfileContextFactory(); |
| 24 | 25 |
| 25 private: | 26 private: |
| 27 // BrowserContextKeyedServiceFactory: |
| 26 KeyedService* BuildServiceInstanceFor( | 28 KeyedService* BuildServiceInstanceFor( |
| 27 content::BrowserContext* profile) const override; | 29 content::BrowserContext* profile) const override; |
| 30 content::BrowserContext* GetBrowserContextToUse( |
| 31 content::BrowserContext* context) const override; |
| 28 | 32 |
| 29 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterProfileContextFactory); | 33 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterProfileContextFactory); |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_
FACTORY_H_ | 36 #endif // CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_PROFILE_CONTEXT_
FACTORY_H_ |
| OLD | NEW |