| 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "chrome/browser/extensions/extension_disabled_ui.h" | 45 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 46 #include "chrome/browser/extensions/extension_error_reporter.h" | 46 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 47 #include "chrome/browser/extensions/extension_error_ui.h" | 47 #include "chrome/browser/extensions/extension_error_ui.h" |
| 48 #include "chrome/browser/extensions/extension_host.h" | 48 #include "chrome/browser/extensions/extension_host.h" |
| 49 #include "chrome/browser/extensions/extension_install_ui.h" | 49 #include "chrome/browser/extensions/extension_install_ui.h" |
| 50 #include "chrome/browser/extensions/extension_process_manager.h" | 50 #include "chrome/browser/extensions/extension_process_manager.h" |
| 51 #include "chrome/browser/extensions/extension_sorting.h" | 51 #include "chrome/browser/extensions/extension_sorting.h" |
| 52 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 52 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 53 #include "chrome/browser/extensions/extension_sync_data.h" | 53 #include "chrome/browser/extensions/extension_sync_data.h" |
| 54 #include "chrome/browser/extensions/extension_system.h" | 54 #include "chrome/browser/extensions/extension_system.h" |
| 55 #include "chrome/browser/extensions/extension_web_ui.h" | |
| 56 #include "chrome/browser/extensions/external_install_ui.h" | 55 #include "chrome/browser/extensions/external_install_ui.h" |
| 57 #include "chrome/browser/extensions/external_provider_impl.h" | 56 #include "chrome/browser/extensions/external_provider_impl.h" |
| 58 #include "chrome/browser/extensions/external_provider_interface.h" | 57 #include "chrome/browser/extensions/external_provider_interface.h" |
| 59 #include "chrome/browser/extensions/installed_loader.h" | 58 #include "chrome/browser/extensions/installed_loader.h" |
| 60 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 59 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 61 #include "chrome/browser/extensions/management_policy.h" | 60 #include "chrome/browser/extensions/management_policy.h" |
| 62 #include "chrome/browser/extensions/pending_extension_manager.h" | 61 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 63 #include "chrome/browser/extensions/permissions_updater.h" | 62 #include "chrome/browser/extensions/permissions_updater.h" |
| 64 #include "chrome/browser/extensions/platform_app_launcher.h" | 63 #include "chrome/browser/extensions/platform_app_launcher.h" |
| 65 #include "chrome/browser/extensions/settings/settings_frontend.h" | 64 #include "chrome/browser/extensions/settings/settings_frontend.h" |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 | 1071 |
| 1073 // Tell a random-ass collection of other subsystems about the new extension. | 1072 // Tell a random-ass collection of other subsystems about the new extension. |
| 1074 // TODO(aa): What should we do with all this goop? Can it move into the | 1073 // TODO(aa): What should we do with all this goop? Can it move into the |
| 1075 // relevant objects via EXTENSION_LOADED? | 1074 // relevant objects via EXTENSION_LOADED? |
| 1076 | 1075 |
| 1077 profile_->GetExtensionSpecialStoragePolicy()-> | 1076 profile_->GetExtensionSpecialStoragePolicy()-> |
| 1078 GrantRightsForExtension(extension); | 1077 GrantRightsForExtension(extension); |
| 1079 | 1078 |
| 1080 UpdateActiveExtensionsInCrashReporter(); | 1079 UpdateActiveExtensionsInCrashReporter(); |
| 1081 | 1080 |
| 1082 ExtensionWebUI::RegisterChromeURLOverrides( | |
| 1083 profile_, extension->GetChromeURLOverrides()); | |
| 1084 | |
| 1085 // If the extension has permission to load chrome://favicon/ resources we need | 1081 // If the extension has permission to load chrome://favicon/ resources we need |
| 1086 // to make sure that the FaviconSource is registered with the | 1082 // to make sure that the FaviconSource is registered with the |
| 1087 // ChromeURLDataManager. | 1083 // ChromeURLDataManager. |
| 1088 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { | 1084 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { |
| 1089 FaviconSource* favicon_source = new FaviconSource(profile_, | 1085 FaviconSource* favicon_source = new FaviconSource(profile_, |
| 1090 FaviconSource::FAVICON); | 1086 FaviconSource::FAVICON); |
| 1091 ChromeURLDataManager::AddDataSource(profile_, favicon_source); | 1087 ChromeURLDataManager::AddDataSource(profile_, favicon_source); |
| 1092 } | 1088 } |
| 1093 | 1089 |
| 1094 #if !defined(OS_ANDROID) | 1090 #if !defined(OS_ANDROID) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 Profile* host_profile = | 1160 Profile* host_profile = |
| 1165 Profile::FromBrowserContext(host->GetBrowserContext()); | 1161 Profile::FromBrowserContext(host->GetBrowserContext()); |
| 1166 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) | 1162 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) |
| 1167 host->Send(new ExtensionMsg_Unloaded(extension->id())); | 1163 host->Send(new ExtensionMsg_Unloaded(extension->id())); |
| 1168 } | 1164 } |
| 1169 | 1165 |
| 1170 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); | 1166 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); |
| 1171 profile_->GetExtensionSpecialStoragePolicy()-> | 1167 profile_->GetExtensionSpecialStoragePolicy()-> |
| 1172 RevokeRightsForExtension(extension); | 1168 RevokeRightsForExtension(extension); |
| 1173 | 1169 |
| 1174 ExtensionWebUI::UnregisterChromeURLOverrides( | |
| 1175 profile_, extension->GetChromeURLOverrides()); | |
| 1176 | |
| 1177 #if defined(OS_CHROMEOS) | 1170 #if defined(OS_CHROMEOS) |
| 1178 // Revoke external file access to third party extensions. | 1171 // Revoke external file access to third party extensions. |
| 1179 fileapi::FileSystemContext* filesystem_context = | 1172 fileapi::FileSystemContext* filesystem_context = |
| 1180 BrowserContext::GetDefaultStoragePartition(profile_)-> | 1173 BrowserContext::GetDefaultStoragePartition(profile_)-> |
| 1181 GetFileSystemContext(); | 1174 GetFileSystemContext(); |
| 1182 if (filesystem_context && filesystem_context->external_provider()) { | 1175 if (filesystem_context && filesystem_context->external_provider()) { |
| 1183 filesystem_context->external_provider()-> | 1176 filesystem_context->external_provider()-> |
| 1184 RevokeAccessForExtension(extension->id()); | 1177 RevokeAccessForExtension(extension->id()); |
| 1185 } | 1178 } |
| 1186 #endif | 1179 #endif |
| (...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3130 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3123 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
| 3131 DCHECK(extension); | 3124 DCHECK(extension); |
| 3132 if (!extension) | 3125 if (!extension) |
| 3133 continue; | 3126 continue; |
| 3134 blacklisted_extensions_.Insert(extension); | 3127 blacklisted_extensions_.Insert(extension); |
| 3135 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3128 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
| 3136 } | 3129 } |
| 3137 | 3130 |
| 3138 IdentifyAlertableExtensions(); | 3131 IdentifyAlertableExtensions(); |
| 3139 } | 3132 } |
| OLD | NEW |