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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 10274013: Revert order of EXTENSION_LOADED and EXTENSION_INSTALLED notifications back to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile fix Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/test_extension_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e2db5c5ced6721ac83f5a8fd016a03f1f6ca304a..8f552df91120aa2eeb92293dab583ef6e0e5f893 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1994,7 +1994,7 @@ void ExtensionService::OnLoadedInstalledExtensions() {
content::NotificationService::NoDetails());
}
-bool ExtensionService::AddExtension(const Extension* extension) {
+void ExtensionService::AddExtension(const Extension* extension) {
// Ensure extension is deleted unless we transfer ownership.
scoped_refptr<const Extension> scoped_extension(extension);
@@ -2005,7 +2005,7 @@ bool ExtensionService::AddExtension(const Extension* extension) {
!extension->is_theme() &&
extension->location() != Extension::COMPONENT &&
!Extension::IsExternalLocation(extension->location()))
- return false;
+ return;
SetBeingUpgraded(extension, false);
@@ -2036,9 +2036,7 @@ bool ExtensionService::AddExtension(const Extension* extension) {
Extension::DISABLE_PERMISSIONS_INCREASE) {
extensions::AddExtensionDisabledError(this, extension);
}
- // Although the extension is disabled, we technically did succeed in adding
- // it to the list of installed extensions.
- return true;
+ return;
}
// All apps that are displayed in the launcher are ordered by their ordinals
@@ -2049,8 +2047,6 @@ bool ExtensionService::AddExtension(const Extension* extension) {
extensions_.Insert(scoped_extension);
SyncExtensionChangeIfNeeded(*extension);
NotifyExtensionLoaded(extension);
-
- return true;
}
void ExtensionService::InitializePermissions(const Extension* extension) {
@@ -2267,13 +2263,13 @@ void ExtensionService::OnExtensionInstalled(
extension_prefs_->SetAllowFileAccess(id, true);
}
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_EXTENSION_INSTALLED,
+ content::Source<Profile>(profile_),
+ content::Details<const Extension>(extension));
+
// Transfer ownership of |extension| to AddExtension.
- if (AddExtension(scoped_extension)) {
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_INSTALLED,
- content::Source<Profile>(profile_),
- content::Details<const Extension>(extension));
- }
+ AddExtension(scoped_extension);
}
const Extension* ExtensionService::GetExtensionByIdInternal(
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/test_extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698