| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_internal_extension_pr
ovider.h" | 5 #include "chrome/browser/content_settings/content_settings_internal_extension_pr
ovider.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/common/chrome_content_client.h" | 8 #include "chrome/common/chrome_content_client.h" |
| 9 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 9 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
| 10 #include "components/content_settings/core/browser/content_settings_rule.h" | 10 #include "components/content_settings/core/browser/content_settings_rule.h" |
| 11 #include "components/content_settings/core/common/content_settings.h" | 11 #include "components/content_settings/core/common/content_settings.h" |
| 12 #include "components/content_settings/core/common/content_settings_pattern.h" | 12 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 13 #include "content/public/browser/browser_thread.h" | |
| 14 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
| 15 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
| 16 #include "extensions/browser/extension_host.h" | 15 #include "extensions/browser/extension_host.h" |
| 17 #include "extensions/browser/notification_types.h" | 16 #include "extensions/browser/notification_types.h" |
| 18 #include "extensions/common/constants.h" | 17 #include "extensions/common/constants.h" |
| 19 #include "extensions/common/extension.h" | 18 #include "extensions/common/extension.h" |
| 20 #include "extensions/common/extension_set.h" | 19 #include "extensions/common/extension_set.h" |
| 21 #include "extensions/common/features/simple_feature.h" | 20 #include "extensions/common/features/simple_feature.h" |
| 22 | 21 |
| 23 using extensions::UnloadedExtensionInfo; | 22 using extensions::UnloadedExtensionInfo; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (extensions::PluginInfo::HasPlugins(info.extension)) | 147 if (extensions::PluginInfo::HasPlugins(info.extension)) |
| 149 SetContentSettingForExtension(info.extension, CONTENT_SETTING_DEFAULT); | 148 SetContentSettingForExtension(info.extension, CONTENT_SETTING_DEFAULT); |
| 150 break; | 149 break; |
| 151 } | 150 } |
| 152 default: | 151 default: |
| 153 NOTREACHED(); | 152 NOTREACHED(); |
| 154 } | 153 } |
| 155 } | 154 } |
| 156 | 155 |
| 157 void InternalExtensionProvider::ShutdownOnUIThread() { | 156 void InternalExtensionProvider::ShutdownOnUIThread() { |
| 158 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 157 DCHECK(CalledOnValidThread()); |
| 159 RemoveAllObservers(); | 158 RemoveAllObservers(); |
| 160 registrar_.reset(); | 159 registrar_.reset(); |
| 161 } | 160 } |
| 162 | 161 |
| 163 void InternalExtensionProvider::SetContentSettingForExtension( | 162 void InternalExtensionProvider::SetContentSettingForExtension( |
| 164 const extensions::Extension* extension, | 163 const extensions::Extension* extension, |
| 165 ContentSetting setting) { | 164 ContentSetting setting) { |
| 166 SetContentSettingForExtensionAndResource( | 165 SetContentSettingForExtensionAndResource( |
| 167 extension, ResourceIdentifier(), setting); | 166 extension, ResourceIdentifier(), setting); |
| 168 } | 167 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 194 new base::FundamentalValue(setting)); | 193 new base::FundamentalValue(setting)); |
| 195 } | 194 } |
| 196 } | 195 } |
| 197 NotifyObservers(primary_pattern, | 196 NotifyObservers(primary_pattern, |
| 198 secondary_pattern, | 197 secondary_pattern, |
| 199 CONTENT_SETTINGS_TYPE_PLUGINS, | 198 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 200 resource); | 199 resource); |
| 201 } | 200 } |
| 202 | 201 |
| 203 } // namespace content_settings | 202 } // namespace content_settings |
| OLD | NEW |