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

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

Issue 289073008: Add TriggerOnUninstalled to ExtensionRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (!extension_prefs_->IsEphemeralApp(extension->id())) 761 if (!extension_prefs_->IsEphemeralApp(extension->id()))
762 extensions::DataDeleter::StartDeleting(profile_, extension.get()); 762 extensions::DataDeleter::StartDeleting(profile_, extension.get());
763 763
764 UntrackTerminatedExtension(extension->id()); 764 UntrackTerminatedExtension(extension->id());
765 765
766 // Notify interested parties that we've uninstalled this extension. 766 // Notify interested parties that we've uninstalled this extension.
767 content::NotificationService::current()->Notify( 767 content::NotificationService::current()->Notify(
768 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 768 chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
769 content::Source<Profile>(profile_), 769 content::Source<Profile>(profile_),
770 content::Details<const Extension>(extension.get())); 770 content::Details<const Extension>(extension.get()));
771 ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(extension.get());
771 772
772 if (extension_sync_service_) { 773 if (extension_sync_service_) {
773 extension_sync_service_->ProcessSyncUninstallExtension(extension->id(), 774 extension_sync_service_->ProcessSyncUninstallExtension(extension->id(),
774 sync_change); 775 sync_change);
775 } 776 }
776 777
777 delayed_installs_.Remove(extension->id()); 778 delayed_installs_.Remove(extension->id());
778 779
779 extension_prefs_->OnExtensionUninstalled( 780 extension_prefs_->OnExtensionUninstalled(
780 extension->id(), extension->location(), external_uninstall); 781 extension->id(), extension->location(), external_uninstall);
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 void ExtensionService::RemoveComponentExtension( 1420 void ExtensionService::RemoveComponentExtension(
1420 const std::string& extension_id) { 1421 const std::string& extension_id) {
1421 scoped_refptr<const Extension> extension( 1422 scoped_refptr<const Extension> extension(
1422 GetExtensionById(extension_id, false)); 1423 GetExtensionById(extension_id, false));
1423 UnloadExtension(extension_id, UnloadedExtensionInfo::REASON_UNINSTALL); 1424 UnloadExtension(extension_id, UnloadedExtensionInfo::REASON_UNINSTALL);
1424 if (extension.get()) { 1425 if (extension.get()) {
1425 content::NotificationService::current()->Notify( 1426 content::NotificationService::current()->Notify(
1426 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 1427 chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
1427 content::Source<Profile>(profile_), 1428 content::Source<Profile>(profile_),
1428 content::Details<const Extension>(extension.get())); 1429 content::Details<const Extension>(extension.get()));
1430 ExtensionRegistry::Get(profile_)->TriggerOnUninstalled(extension.get());
1429 } 1431 }
1430 } 1432 }
1431 1433
1432 void ExtensionService::UnloadAllExtensionsForTest() { 1434 void ExtensionService::UnloadAllExtensionsForTest() {
1433 UnloadAllExtensionsInternal(); 1435 UnloadAllExtensionsInternal();
1434 } 1436 }
1435 1437
1436 void ExtensionService::ReloadExtensionsForTest() { 1438 void ExtensionService::ReloadExtensionsForTest() {
1437 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit 1439 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit
1438 // warning about calling test code in production. 1440 // warning about calling test code in production.
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 } 2472 }
2471 2473
2472 void ExtensionService::OnProfileDestructionStarted() { 2474 void ExtensionService::OnProfileDestructionStarted() {
2473 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2475 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2474 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2476 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2475 it != ids_to_unload.end(); 2477 it != ids_to_unload.end();
2476 ++it) { 2478 ++it) {
2477 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2479 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2478 } 2480 }
2479 } 2481 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698