| 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/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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #include "extensions/common/feature_switch.h" | 76 #include "extensions/common/feature_switch.h" |
| 77 #include "extensions/common/file_util.h" | 77 #include "extensions/common/file_util.h" |
| 78 #include "extensions/common/manifest_constants.h" | 78 #include "extensions/common/manifest_constants.h" |
| 79 #include "extensions/common/manifest_handlers/background_info.h" | 79 #include "extensions/common/manifest_handlers/background_info.h" |
| 80 #include "extensions/common/one_shot_event.h" | 80 #include "extensions/common/one_shot_event.h" |
| 81 #include "extensions/common/permissions/permission_message_provider.h" | 81 #include "extensions/common/permissions/permission_message_provider.h" |
| 82 #include "extensions/common/permissions/permissions_data.h" | 82 #include "extensions/common/permissions/permissions_data.h" |
| 83 | 83 |
| 84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 85 #include "chrome/browser/chromeos/extensions/install_limiter.h" | 85 #include "chrome/browser/chromeos/extensions/install_limiter.h" |
| 86 #include "webkit/browser/fileapi/file_system_backend.h" | 86 #include "storage/browser/fileapi/file_system_backend.h" |
| 87 #include "webkit/browser/fileapi/file_system_context.h" | 87 #include "storage/browser/fileapi/file_system_context.h" |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 using content::BrowserContext; | 90 using content::BrowserContext; |
| 91 using content::BrowserThread; | 91 using content::BrowserThread; |
| 92 using content::DevToolsAgentHost; | 92 using content::DevToolsAgentHost; |
| 93 using extensions::CrxInstaller; | 93 using extensions::CrxInstaller; |
| 94 using extensions::Extension; | 94 using extensions::Extension; |
| 95 using extensions::ExtensionDownloader; | 95 using extensions::ExtensionDownloader; |
| 96 using extensions::ExtensionDownloaderDelegate; | 96 using extensions::ExtensionDownloaderDelegate; |
| 97 using extensions::ExtensionIdSet; | 97 using extensions::ExtensionIdSet; |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 // BrowserContextKeyedService and use ExtensionRegistryObserver. | 1092 // BrowserContextKeyedService and use ExtensionRegistryObserver. |
| 1093 profile_->GetExtensionSpecialStoragePolicy()-> | 1093 profile_->GetExtensionSpecialStoragePolicy()-> |
| 1094 RevokeRightsForExtension(extension); | 1094 RevokeRightsForExtension(extension); |
| 1095 | 1095 |
| 1096 #if defined(OS_CHROMEOS) | 1096 #if defined(OS_CHROMEOS) |
| 1097 // Revoke external file access for the extension from its file system context. | 1097 // Revoke external file access for the extension from its file system context. |
| 1098 // It is safe to access the extension's storage partition at this point. The | 1098 // It is safe to access the extension's storage partition at this point. The |
| 1099 // storage partition may get destroyed only after the extension gets unloaded. | 1099 // storage partition may get destroyed only after the extension gets unloaded. |
| 1100 GURL site = | 1100 GURL site = |
| 1101 extensions::util::GetSiteForExtensionId(extension->id(), profile_); | 1101 extensions::util::GetSiteForExtensionId(extension->id(), profile_); |
| 1102 fileapi::FileSystemContext* filesystem_context = | 1102 storage::FileSystemContext* filesystem_context = |
| 1103 BrowserContext::GetStoragePartitionForSite(profile_, site)-> | 1103 BrowserContext::GetStoragePartitionForSite(profile_, site) |
| 1104 GetFileSystemContext(); | 1104 ->GetFileSystemContext(); |
| 1105 if (filesystem_context && filesystem_context->external_backend()) { | 1105 if (filesystem_context && filesystem_context->external_backend()) { |
| 1106 filesystem_context->external_backend()-> | 1106 filesystem_context->external_backend()-> |
| 1107 RevokeAccessForExtension(extension->id()); | 1107 RevokeAccessForExtension(extension->id()); |
| 1108 } | 1108 } |
| 1109 #endif | 1109 #endif |
| 1110 | 1110 |
| 1111 // TODO(kalman): This is broken. The crash reporter is process-wide so doesn't | 1111 // TODO(kalman): This is broken. The crash reporter is process-wide so doesn't |
| 1112 // work properly multi-profile. Besides which, it should be using | 1112 // work properly multi-profile. Besides which, it should be using |
| 1113 // ExtensionRegistryObserver::OnExtensionLoaded. See http://crbug.com/355029. | 1113 // ExtensionRegistryObserver::OnExtensionLoaded. See http://crbug.com/355029. |
| 1114 UpdateActiveExtensionsInCrashReporter(); | 1114 UpdateActiveExtensionsInCrashReporter(); |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2362 } | 2362 } |
| 2363 | 2363 |
| 2364 void ExtensionService::OnProfileDestructionStarted() { | 2364 void ExtensionService::OnProfileDestructionStarted() { |
| 2365 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2365 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2366 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2366 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2367 it != ids_to_unload.end(); | 2367 it != ids_to_unload.end(); |
| 2368 ++it) { | 2368 ++it) { |
| 2369 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2369 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2370 } | 2370 } |
| 2371 } | 2371 } |
| OLD | NEW |