Index: chrome/browser/content_settings/content_settings_platform_app_provider.h |
diff --git a/chrome/browser/content_settings/content_settings_platform_app_provider.h b/chrome/browser/content_settings/content_settings_platform_app_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ee52f88452bb75c762d176173b467e06a0c508f3 |
--- /dev/null |
+++ b/chrome/browser/content_settings/content_settings_platform_app_provider.h |
@@ -0,0 +1,63 @@ |
+// Copyright (c) 2012 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_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H_ |
+#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/memory/ref_counted.h" |
+#include "base/synchronization/lock.h" |
+#include "chrome/browser/content_settings/content_settings_observable_provider.h" |
+#include "chrome/browser/content_settings/content_settings_origin_identifier_value_map.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+ |
+namespace content_settings { |
+ |
+// A content settings provider which disables certain plugins for platform apps. |
+class PlatformAppProvider : public ObservableProvider, |
+ public content::NotificationObserver { |
+ public: |
+ PlatformAppProvider(); |
+ |
+ virtual ~PlatformAppProvider() { } |
+ |
+ // ProviderInterface methods: |
+ virtual RuleIterator* GetRuleIterator( |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ bool incognito) const OVERRIDE; |
+ |
+ virtual bool SetWebsiteSetting( |
+ const ContentSettingsPattern& primary_pattern, |
+ const ContentSettingsPattern& secondary_pattern, |
+ ContentSettingsType content_type, |
+ const ResourceIdentifier& resource_identifier, |
+ Value* value) OVERRIDE { return false; } |
Bernhard Bauer
2012/01/25 13:59:04
Inlining virtual methods doesn't make much sense,
benwells
2012/01/27 04:03:52
Done, and thanks for the link its got some good st
|
+ |
+ virtual void ClearAllContentSettingsRules(ContentSettingsType content_type) |
+ OVERRIDE { } |
+ |
+ virtual void ShutdownOnUIThread() OVERRIDE; |
+ |
+ // content::NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ private: |
+ OriginIdentifierValueMap value_map_; |
+ |
+ // Used around accesses to the |value_map_| list to guarantee thread safety. |
+ mutable base::Lock lock_; |
+ content::NotificationRegistrar registrar_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PlatformAppProvider); |
+}; |
+ |
+} // namespace content_settings |
+ |
+#endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H_ |