OLD | NEW |
---|---|
(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 <string> | |
9 #include <vector> | |
10 | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/synchronization/lock.h" | |
13 #include "chrome/browser/content_settings/content_settings_observable_provider.h " | |
14 #include "chrome/browser/content_settings/content_settings_origin_identifier_val ue_map.h" | |
15 #include "chrome/browser/profiles/profile.h" | |
16 #include "content/public/browser/notification_observer.h" | |
17 #include "content/public/browser/notification_registrar.h" | |
18 | |
19 namespace content_settings { | |
20 | |
21 // A content settings provider which disables certain plugins for platform apps. | |
22 class PlatformAppProvider : public ObservableProvider, | |
23 public content::NotificationObserver { | |
24 public: | |
25 PlatformAppProvider(); | |
26 | |
27 virtual ~PlatformAppProvider() { } | |
28 | |
29 // ProviderInterface methods: | |
30 virtual RuleIterator* GetRuleIterator( | |
31 ContentSettingsType content_type, | |
32 const ResourceIdentifier& resource_identifier, | |
33 bool incognito) const OVERRIDE; | |
34 | |
35 virtual bool SetWebsiteSetting( | |
36 const ContentSettingsPattern& primary_pattern, | |
37 const ContentSettingsPattern& secondary_pattern, | |
38 ContentSettingsType content_type, | |
39 const ResourceIdentifier& resource_identifier, | |
40 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
| |
41 | |
42 virtual void ClearAllContentSettingsRules(ContentSettingsType content_type) | |
43 OVERRIDE { } | |
44 | |
45 virtual void ShutdownOnUIThread() OVERRIDE; | |
46 | |
47 // content::NotificationObserver implementation. | |
48 virtual void Observe(int type, | |
49 const content::NotificationSource& source, | |
50 const content::NotificationDetails& details) OVERRIDE; | |
51 private: | |
52 OriginIdentifierValueMap value_map_; | |
53 | |
54 // Used around accesses to the |value_map_| list to guarantee thread safety. | |
55 mutable base::Lock lock_; | |
56 content::NotificationRegistrar registrar_; | |
57 | |
58 DISALLOW_COPY_AND_ASSIGN(PlatformAppProvider); | |
59 }; | |
60 | |
61 } // namespace content_settings | |
62 | |
63 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDE R_H_ | |
OLD | NEW |