OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H
_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H
_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H
_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDER_H
_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" | 10 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" |
11 #include "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" | 11 #include "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" |
12 #include "chrome/common/content_settings.h" | 12 #include "chrome/common/content_settings.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 | 15 |
| 16 class ExtensionService; |
| 17 |
| 18 namespace extensions { |
16 class Extension; | 19 class Extension; |
17 class ExtensionService; | 20 } |
18 | 21 |
19 namespace content_settings { | 22 namespace content_settings { |
20 | 23 |
21 // A content settings provider which disables certain plugins for platform apps. | 24 // A content settings provider which disables certain plugins for platform apps. |
22 class PlatformAppProvider : public ObservableProvider, | 25 class PlatformAppProvider : public ObservableProvider, |
23 public content::NotificationObserver { | 26 public content::NotificationObserver { |
24 public: | 27 public: |
25 explicit PlatformAppProvider(ExtensionService* extension_service); | 28 explicit PlatformAppProvider(ExtensionService* extension_service); |
26 | 29 |
27 virtual ~PlatformAppProvider(); | 30 virtual ~PlatformAppProvider(); |
(...skipping 14 matching lines...) Expand all Loading... |
42 virtual void ClearAllContentSettingsRules(ContentSettingsType content_type) | 45 virtual void ClearAllContentSettingsRules(ContentSettingsType content_type) |
43 OVERRIDE; | 46 OVERRIDE; |
44 | 47 |
45 virtual void ShutdownOnUIThread() OVERRIDE; | 48 virtual void ShutdownOnUIThread() OVERRIDE; |
46 | 49 |
47 // content::NotificationObserver implementation. | 50 // content::NotificationObserver implementation. |
48 virtual void Observe(int type, | 51 virtual void Observe(int type, |
49 const content::NotificationSource& source, | 52 const content::NotificationSource& source, |
50 const content::NotificationDetails& details) OVERRIDE; | 53 const content::NotificationDetails& details) OVERRIDE; |
51 private: | 54 private: |
52 void SetContentSettingForExtension(const Extension* extension, | 55 void SetContentSettingForExtension(const extensions::Extension* extension, |
53 ContentSetting setting); | 56 ContentSetting setting); |
54 | 57 |
55 OriginIdentifierValueMap value_map_; | 58 OriginIdentifierValueMap value_map_; |
56 | 59 |
57 // Used around accesses to the |value_map_| list to guarantee thread safety. | 60 // Used around accesses to the |value_map_| list to guarantee thread safety. |
58 mutable base::Lock lock_; | 61 mutable base::Lock lock_; |
59 scoped_ptr<content::NotificationRegistrar> registrar_; | 62 scoped_ptr<content::NotificationRegistrar> registrar_; |
60 | 63 |
61 DISALLOW_COPY_AND_ASSIGN(PlatformAppProvider); | 64 DISALLOW_COPY_AND_ASSIGN(PlatformAppProvider); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace content_settings | 67 } // namespace content_settings |
65 | 68 |
66 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDE
R_H_ | 69 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PLATFORM_APP_PROVIDE
R_H_ |
OLD | NEW |