Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 using content::BrowserContext; | 78 using content::BrowserContext; |
| 79 using content::BrowserThread; | 79 using content::BrowserThread; |
| 80 using content::DevToolsAgentHost; | 80 using content::DevToolsAgentHost; |
| 81 using extensions::CrxInstaller; | 81 using extensions::CrxInstaller; |
| 82 using extensions::Extension; | 82 using extensions::Extension; |
| 83 using extensions::ExtensionIdSet; | 83 using extensions::ExtensionIdSet; |
| 84 using extensions::ExtensionInfo; | 84 using extensions::ExtensionInfo; |
| 85 using extensions::ExtensionRegistry; | 85 using extensions::ExtensionRegistry; |
| 86 using extensions::ExtensionSet; | 86 using extensions::ExtensionSet; |
| 87 using extensions::FeatureSwitch; | 87 using extensions::FeatureSwitch; |
| 88 using extensions::InstalledExtensionInfo; | |
|
not at google - send to devlin
2014/05/16 13:49:03
doesn't add much
limasdf
2014/05/16 20:39:14
Done. let me move ExtensionService into extensions
not at google - send to devlin
2014/05/16 23:03:35
one day :)
or perhaps let's leave it outside the
| |
| 88 using extensions::InstallVerifier; | 89 using extensions::InstallVerifier; |
| 89 using extensions::ManagementPolicy; | 90 using extensions::ManagementPolicy; |
| 90 using extensions::Manifest; | 91 using extensions::Manifest; |
| 91 using extensions::PermissionMessage; | 92 using extensions::PermissionMessage; |
| 92 using extensions::PermissionMessages; | 93 using extensions::PermissionMessages; |
| 93 using extensions::PermissionSet; | 94 using extensions::PermissionSet; |
| 94 using extensions::SharedModuleInfo; | 95 using extensions::SharedModuleInfo; |
| 95 using extensions::SharedModuleService; | 96 using extensions::SharedModuleService; |
| 96 using extensions::UnloadedExtensionInfo; | 97 using extensions::UnloadedExtensionInfo; |
| 97 | 98 |
| (...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1908 bool is_update = false; | 1909 bool is_update = false; |
| 1909 std::string old_name; | 1910 std::string old_name; |
| 1910 if (existing_extension) { | 1911 if (existing_extension) { |
| 1911 is_update = true; | 1912 is_update = true; |
| 1912 old_name = existing_extension->name(); | 1913 old_name = existing_extension->name(); |
| 1913 } | 1914 } |
| 1914 extensions::InstalledExtensionInfo details(extension, is_update, old_name); | 1915 extensions::InstalledExtensionInfo details(extension, is_update, old_name); |
| 1915 content::NotificationService::current()->Notify( | 1916 content::NotificationService::current()->Notify( |
| 1916 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 1917 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
| 1917 content::Source<Profile>(profile_), | 1918 content::Source<Profile>(profile_), |
| 1918 content::Details<const extensions::InstalledExtensionInfo>(&details)); | 1919 content::Details<const InstalledExtensionInfo>(&details)); |
| 1920 | |
| 1921 ExtensionRegistry::Get(profile_) | |
| 1922 ->TriggerOnInstalled(extension, is_update, old_name); | |
| 1919 | 1923 |
| 1920 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); | 1924 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); |
| 1921 | 1925 |
| 1922 // Unpacked extensions default to allowing file access, but if that has been | 1926 // Unpacked extensions default to allowing file access, but if that has been |
| 1923 // overridden, don't reset the value. | 1927 // overridden, don't reset the value. |
| 1924 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && | 1928 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && |
| 1925 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { | 1929 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { |
| 1926 extension_prefs_->SetAllowFileAccess(extension->id(), true); | 1930 extension_prefs_->SetAllowFileAccess(extension->id(), true); |
| 1927 } | 1931 } |
| 1928 | 1932 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2408 void ExtensionService::UnloadAllExtensionsInternal() { | 2412 void ExtensionService::UnloadAllExtensionsInternal() { |
| 2409 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2413 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
| 2410 | 2414 |
| 2411 registry_->ClearAll(); | 2415 registry_->ClearAll(); |
| 2412 system_->runtime_data()->ClearAll(); | 2416 system_->runtime_data()->ClearAll(); |
| 2413 | 2417 |
| 2414 // TODO(erikkay) should there be a notification for this? We can't use | 2418 // TODO(erikkay) should there be a notification for this? We can't use |
| 2415 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2419 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
| 2416 // or uninstalled. | 2420 // or uninstalled. |
| 2417 } | 2421 } |
| OLD | NEW |