Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 279073003: Add a function triggering extension installed to ExtensionRegistryObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 if (existing_extension) { 1910 if (existing_extension) {
1911 is_update = true; 1911 is_update = true;
1912 old_name = existing_extension->name(); 1912 old_name = existing_extension->name();
1913 } 1913 }
1914 extensions::InstalledExtensionInfo details(extension, is_update, old_name); 1914 extensions::InstalledExtensionInfo details(extension, is_update, old_name);
1915 content::NotificationService::current()->Notify( 1915 content::NotificationService::current()->Notify(
1916 chrome::NOTIFICATION_EXTENSION_INSTALLED, 1916 chrome::NOTIFICATION_EXTENSION_INSTALLED,
1917 content::Source<Profile>(profile_), 1917 content::Source<Profile>(profile_),
1918 content::Details<const extensions::InstalledExtensionInfo>(&details)); 1918 content::Details<const extensions::InstalledExtensionInfo>(&details));
1919 1919
1920 ExtensionRegistry::Get(profile_)->TriggerOnInstalled(extension, details);
1921
1920 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); 1922 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension);
1921 1923
1922 // Unpacked extensions default to allowing file access, but if that has been 1924 // Unpacked extensions default to allowing file access, but if that has been
1923 // overridden, don't reset the value. 1925 // overridden, don't reset the value.
1924 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && 1926 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) &&
1925 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { 1927 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) {
1926 extension_prefs_->SetAllowFileAccess(extension->id(), true); 1928 extension_prefs_->SetAllowFileAccess(extension->id(), true);
1927 } 1929 }
1928 1930
1929 AddExtension(extension); 1931 AddExtension(extension);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 void ExtensionService::UnloadAllExtensionsInternal() { 2410 void ExtensionService::UnloadAllExtensionsInternal() {
2409 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); 2411 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions();
2410 2412
2411 registry_->ClearAll(); 2413 registry_->ClearAll();
2412 system_->runtime_data()->ClearAll(); 2414 system_->runtime_data()->ClearAll();
2413 2415
2414 // TODO(erikkay) should there be a notification for this? We can't use 2416 // 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 2417 // EXTENSION_UNLOADED since that implies that the extension has been disabled
2416 // or uninstalled. 2418 // or uninstalled.
2417 } 2419 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/install_tracker.h » ('j') | chrome/browser/extensions/install_tracker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698