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 #include "chrome/browser/content_settings/content_settings_platform_app_provider
.h" | 5 #include "chrome/browser/content_settings/content_settings_platform_app_provider
.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/content_settings_rule.h" | 7 #include "chrome/browser/content_settings/content_settings_rule.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 void PlatformAppProvider::ClearAllContentSettingsRules( | 62 void PlatformAppProvider::ClearAllContentSettingsRules( |
63 ContentSettingsType content_type) {} | 63 ContentSettingsType content_type) {} |
64 | 64 |
65 void PlatformAppProvider::Observe(int type, | 65 void PlatformAppProvider::Observe(int type, |
66 const content::NotificationSource& source, | 66 const content::NotificationSource& source, |
67 const content::NotificationDetails& details) { | 67 const content::NotificationDetails& details) { |
68 switch (type) { | 68 switch (type) { |
69 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: { | 69 case chrome::NOTIFICATION_EXTENSION_HOST_CREATED: { |
70 const ExtensionHost* host = | 70 const extensions::ExtensionHost* host = |
71 content::Details<ExtensionHost>(details).ptr(); | 71 content::Details<extensions::ExtensionHost>(details).ptr(); |
72 if (host->extension()->is_platform_app()) | 72 if (host->extension()->is_platform_app()) |
73 SetContentSettingForExtension(host->extension(), CONTENT_SETTING_BLOCK); | 73 SetContentSettingForExtension(host->extension(), CONTENT_SETTING_BLOCK); |
74 break; | 74 break; |
75 } | 75 } |
76 case chrome::NOTIFICATION_EXTENSION_LOADED: { | 76 case chrome::NOTIFICATION_EXTENSION_LOADED: { |
77 const extensions::Extension* extension = | 77 const extensions::Extension* extension = |
78 content::Details<extensions::Extension>(details).ptr(); | 78 content::Details<extensions::Extension>(details).ptr(); |
79 if (extension->plugins().size() > 0) | 79 if (extension->plugins().size() > 0) |
80 SetContentSettingForExtension(extension, CONTENT_SETTING_ALLOW); | 80 SetContentSettingForExtension(extension, CONTENT_SETTING_ALLOW); |
81 break; | 81 break; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 Value::CreateIntegerValue(setting)); | 124 Value::CreateIntegerValue(setting)); |
125 } | 125 } |
126 } | 126 } |
127 NotifyObservers(primary_pattern, | 127 NotifyObservers(primary_pattern, |
128 secondary_pattern, | 128 secondary_pattern, |
129 CONTENT_SETTINGS_TYPE_PLUGINS, | 129 CONTENT_SETTINGS_TYPE_PLUGINS, |
130 ResourceIdentifier("")); | 130 ResourceIdentifier("")); |
131 } | 131 } |
132 | 132 |
133 } // namespace content_settings | 133 } // namespace content_settings |
OLD | NEW |