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 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 if (existing_extension) { | 1926 if (existing_extension) { |
1927 is_update = true; | 1927 is_update = true; |
1928 old_name = existing_extension->name(); | 1928 old_name = existing_extension->name(); |
1929 } | 1929 } |
1930 extensions::InstalledExtensionInfo details(extension, is_update, old_name); | 1930 extensions::InstalledExtensionInfo details(extension, is_update, old_name); |
1931 content::NotificationService::current()->Notify( | 1931 content::NotificationService::current()->Notify( |
1932 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 1932 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
1933 content::Source<Profile>(profile_), | 1933 content::Source<Profile>(profile_), |
1934 content::Details<const extensions::InstalledExtensionInfo>(&details)); | 1934 content::Details<const extensions::InstalledExtensionInfo>(&details)); |
1935 | 1935 |
| 1936 ExtensionRegistry::Get(profile_) |
| 1937 ->TriggerOnWillBeInstalled(extension, is_update, old_name); |
| 1938 |
1936 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); | 1939 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); |
1937 | 1940 |
1938 // Unpacked extensions default to allowing file access, but if that has been | 1941 // Unpacked extensions default to allowing file access, but if that has been |
1939 // overridden, don't reset the value. | 1942 // overridden, don't reset the value. |
1940 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && | 1943 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && |
1941 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { | 1944 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { |
1942 extension_prefs_->SetAllowFileAccess(extension->id(), true); | 1945 extension_prefs_->SetAllowFileAccess(extension->id(), true); |
1943 } | 1946 } |
1944 | 1947 |
1945 AddExtension(extension); | 1948 AddExtension(extension); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 } | 2440 } |
2438 | 2441 |
2439 void ExtensionService::OnProfileDestructionStarted() { | 2442 void ExtensionService::OnProfileDestructionStarted() { |
2440 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2443 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2441 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2444 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2442 it != ids_to_unload.end(); | 2445 it != ids_to_unload.end(); |
2443 ++it) { | 2446 ++it) { |
2444 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2447 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2445 } | 2448 } |
2446 } | 2449 } |
OLD | NEW |