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

Side by Side Diff: chrome/browser/content_settings/content_settings_platform_app_provider.h

Issue 9169042: Block plugins for platform apps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix plugin_tests on linux Created 8 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H _
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H _
7
8 #include "base/synchronization/lock.h"
9 #include "chrome/browser/content_settings/content_settings_observable_provider.h "
10 #include "chrome/browser/content_settings/content_settings_origin_identifier_val ue_map.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
13
14 namespace content_settings {
15
16 // A content settings provider which disables certain plugins for platform apps.
17 class PlatformAppProvider : public ObservableProvider,
18 public content::NotificationObserver {
19 public:
20 PlatformAppProvider();
21
22 virtual ~PlatformAppProvider();
23
24 // ProviderInterface methods:
25 virtual RuleIterator* GetRuleIterator(
26 ContentSettingsType content_type,
27 const ResourceIdentifier& resource_identifier,
28 bool incognito) const OVERRIDE;
29
30 virtual bool SetWebsiteSetting(
31 const ContentSettingsPattern& primary_pattern,
32 const ContentSettingsPattern& secondary_pattern,
33 ContentSettingsType content_type,
34 const ResourceIdentifier& resource_identifier,
35 Value* value) OVERRIDE;
36
37 virtual void ClearAllContentSettingsRules(ContentSettingsType content_type)
38 OVERRIDE;
39
40 virtual void ShutdownOnUIThread() OVERRIDE;
41
42 // content::NotificationObserver implementation.
43 virtual void Observe(int type,
44 const content::NotificationSource& source,
45 const content::NotificationDetails& details) OVERRIDE;
46 private:
47 OriginIdentifierValueMap value_map_;
48
49 // Used around accesses to the |value_map_| list to guarantee thread safety.
50 mutable base::Lock lock_;
51 content::NotificationRegistrar* registrar_;
52
53 DISALLOW_COPY_AND_ASSIGN(PlatformAppProvider);
54 };
55
56 } // namespace content_settings
57
58 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698