Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: chrome/browser/subresource_filter/subresource_filter_content_settings_observer_factory.h

Issue 2777093007: [subresource_filter] Add metrics for UI / related things (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698