| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 | 1061 |
| 1063 // Tell a random-ass collection of other subsystems about the new extension. | 1062 // Tell a random-ass collection of other subsystems about the new extension. |
| 1064 // TODO(aa): What should we do with all this goop? Can it move into the | 1063 // TODO(aa): What should we do with all this goop? Can it move into the |
| 1065 // relevant objects via EXTENSION_LOADED? | 1064 // relevant objects via EXTENSION_LOADED? |
| 1066 | 1065 |
| 1067 profile_->GetExtensionSpecialStoragePolicy()-> | 1066 profile_->GetExtensionSpecialStoragePolicy()-> |
| 1068 GrantRightsForExtension(extension); | 1067 GrantRightsForExtension(extension); |
| 1069 | 1068 |
| 1070 UpdateActiveExtensionsInCrashReporter(); | 1069 UpdateActiveExtensionsInCrashReporter(); |
| 1071 | 1070 |
| 1072 ExtensionWebUI::RegisterChromeURLOverrides( | |
| 1073 profile_, extension->GetChromeURLOverrides()); | |
| 1074 | |
| 1075 // If the extension has permission to load chrome://favicon/ resources we need | 1071 // If the extension has permission to load chrome://favicon/ resources we need |
| 1076 // to make sure that the FaviconSource is registered with the | 1072 // to make sure that the FaviconSource is registered with the |
| 1077 // ChromeURLDataManager. | 1073 // ChromeURLDataManager. |
| 1078 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { | 1074 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { |
| 1079 FaviconSource* favicon_source = new FaviconSource(profile_, | 1075 FaviconSource* favicon_source = new FaviconSource(profile_, |
| 1080 FaviconSource::FAVICON); | 1076 FaviconSource::FAVICON); |
| 1081 ChromeURLDataManager::AddDataSource(profile_, favicon_source); | 1077 ChromeURLDataManager::AddDataSource(profile_, favicon_source); |
| 1082 } | 1078 } |
| 1083 | 1079 |
| 1084 #if !defined(OS_ANDROID) | 1080 #if !defined(OS_ANDROID) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 Profile* host_profile = | 1152 Profile* host_profile = |
| 1157 Profile::FromBrowserContext(host->GetBrowserContext()); | 1153 Profile::FromBrowserContext(host->GetBrowserContext()); |
| 1158 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) | 1154 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) |
| 1159 host->Send(new ExtensionMsg_Unloaded(extension->id())); | 1155 host->Send(new ExtensionMsg_Unloaded(extension->id())); |
| 1160 } | 1156 } |
| 1161 | 1157 |
| 1162 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); | 1158 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); |
| 1163 profile_->GetExtensionSpecialStoragePolicy()-> | 1159 profile_->GetExtensionSpecialStoragePolicy()-> |
| 1164 RevokeRightsForExtension(extension); | 1160 RevokeRightsForExtension(extension); |
| 1165 | 1161 |
| 1166 ExtensionWebUI::UnregisterChromeURLOverrides( | |
| 1167 profile_, extension->GetChromeURLOverrides()); | |
| 1168 | |
| 1169 #if defined(OS_CHROMEOS) | 1162 #if defined(OS_CHROMEOS) |
| 1170 // Revoke external file access to third party extensions. | 1163 // Revoke external file access to third party extensions. |
| 1171 fileapi::FileSystemContext* filesystem_context = | 1164 fileapi::FileSystemContext* filesystem_context = |
| 1172 BrowserContext::GetDefaultStoragePartition(profile_)-> | 1165 BrowserContext::GetDefaultStoragePartition(profile_)-> |
| 1173 GetFileSystemContext(); | 1166 GetFileSystemContext(); |
| 1174 if (filesystem_context && filesystem_context->external_provider()) { | 1167 if (filesystem_context && filesystem_context->external_provider()) { |
| 1175 filesystem_context->external_provider()-> | 1168 filesystem_context->external_provider()-> |
| 1176 RevokeAccessForExtension(extension->id()); | 1169 RevokeAccessForExtension(extension->id()); |
| 1177 } | 1170 } |
| 1178 #endif | 1171 #endif |
| (...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3115 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
| 3123 DCHECK(extension); | 3116 DCHECK(extension); |
| 3124 if (!extension) | 3117 if (!extension) |
| 3125 continue; | 3118 continue; |
| 3126 blacklisted_extensions_.Insert(extension); | 3119 blacklisted_extensions_.Insert(extension); |
| 3127 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3120 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
| 3128 } | 3121 } |
| 3129 | 3122 |
| 3130 IdentifyAlertableExtensions(); | 3123 IdentifyAlertableExtensions(); |
| 3131 } | 3124 } |
| OLD | NEW |