diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-07 07:57:11 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-07 07:57:11 +0000 |
commit | 87e3000af56457e7f1e7f5b5cc2c8bb1a03120ef (patch) | |
tree | 09df4603ced3d3b098ff46fe6b42a2b0911a1b84 /chrome/browser/content_settings/content_settings_platform_app_provider.h | |
parent | d6a0d295c4106c105342a05bd581aa983b8650ca (diff) | |
download | chromium_src-87e3000af56457e7f1e7f5b5cc2c8bb1a03120ef.zip chromium_src-87e3000af56457e7f1e7f5b5cc2c8bb1a03120ef.tar.gz chromium_src-87e3000af56457e7f1e7f5b5cc2c8bb1a03120ef.tar.bz2 |
Block plugins for platform apps
To block plugins a new content settings has been
added, with the highest priority (i.e. at the front of
the list). This could be used down the track to hang
off more platform app specific stuff.
The provider knows which platform apps have been run
by watching a new notification.
BUG=None
TEST=Tested manually on Windows
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=120541
Review URL: http://codereview.chromium.org/9169042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/content_settings_platform_app_provider.h')
-rw-r--r-- | chrome/browser/content_settings/content_settings_platform_app_provider.h | 58 |
1 files changed, 58 insertions, 0 deletions
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 0000000..0f39898 --- /dev/null +++ b/chrome/browser/content_settings/content_settings_platform_app_provider.h @@ -0,0 +1,58 @@ +// 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 "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 "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; + + 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_ |