Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #344 from brave/chrome.runtime.onInstalled
Browse files Browse the repository at this point in the history
Implement chrome.runtime.onInstalled
  • Loading branch information
bbondy committed Oct 15, 2017
1 parent 2e91227 commit 54817d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atom/browser/extensions/atom_extension_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,10 @@ const Extension* AtomExtensionSystem::Shared::AddExtension(
bool is_extension_upgrade = false;
bool is_extension_loaded = false;
const Extension* old = GetInstalledExtension(extension->id());
std::string old_name;
if (old) {
is_extension_loaded = true;
old_name = old->name();
int version_compare_result =
extension->version()->CompareTo(*(old->version()));
is_extension_upgrade = version_compare_result > 0;
Expand All @@ -315,6 +317,8 @@ const Extension* AtomExtensionSystem::Shared::AddExtension(
DCHECK_GE(version_compare_result, 0);
}
}
registry_->TriggerOnWillBeInstalled(extension,
is_extension_upgrade, old_name);

// Set the upgraded bit; we consider reloads upgrades.
runtime_data()->SetBeingUpgraded(extension->id(),
Expand Down

0 comments on commit 54817d1

Please sign in to comment.