Index: chrome/browser/subresource_filter/subresource_filter_content_settings_observer_factory.h |
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_observer_factory.h b/chrome/browser/subresource_filter/subresource_filter_content_settings_observer_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2cdb7a7721d6d779b980ce6f1e4bd4293701ea11 |
--- /dev/null |
+++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_observer_factory.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_CONTENT_SETTINGS_OBSERVER_FACTORY_H_ |
+#define CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_CONTENT_SETTINGS_OBSERVER_FACTORY_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "components/content_settings/core/browser/content_settings_observer.h" |
+#include "components/content_settings/core/common/content_settings.h" |
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
+#include "components/keyed_service/core/keyed_service.h" |
+ |
+class ContentSettingsPattern; |
+class HostContentSettingsMap; |
+class Profile; |
+ |
+class SubresourceFilterContentSettingsObserver |
msramek
2017/03/29 09:41:25
optional nit: Putting the KeyedService to the same
Charlie Harrison
2017/03/29 15:23:32
Putting this anonymous in the cc file sounds good
|
+ : public KeyedService, |
+ public content_settings::Observer { |
+ public: |
+ explicit SubresourceFilterContentSettingsObserver(Profile* profile); |
+ ~SubresourceFilterContentSettingsObserver() override {} |
+ |
+ private: |
+ // KeyedService: |
+ void Shutdown() override; |
+ |
+ // content_settings::Observer: |
+ void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, |
+ const ContentSettingsPattern& secondary_pattern, |
+ ContentSettingsType content_type, |
+ std::string resource_identifier) override; |
+ |
+ ContentSetting GetContentSettingForUrl(const GURL& url); |
+ |
+ HostContentSettingsMap* settings_map_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterContentSettingsObserver); |
+}; |
+ |
+class SubresourceFilterContentSettingsObserverFactory |
msramek
2017/03/29 09:41:25
I share your feeling that a KeyedService seems lik
Charlie Harrison
2017/03/29 15:23:32
Acknowledged.
|
+ : public BrowserContextKeyedServiceFactory { |
+ public: |
+ static SubresourceFilterContentSettingsObserver* GetForProfile( |
+ Profile* profile); |
+ |
+ static SubresourceFilterContentSettingsObserverFactory* GetInstance(); |
+ |
+ SubresourceFilterContentSettingsObserverFactory(); |
+ |
+ KeyedService* BuildServiceInstanceFor( |
+ content::BrowserContext* profile) const override; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterContentSettingsObserverFactory); |
+}; |
+ |
+#endif // CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_CONTENT_SETTINGS_OBSERVER_FACTORY_H_ |