+bool InstallVerifier::WasInstalledAfterSignature(const std::string& id) const {
+ if (!signature_.get() || signature_->timestamp.is_null())
+ return true;
+
+ base::Time install_time = prefs_->GetInstallTime(id);
+ // If the extension install time is in the future, just assume it isn't
+ // newer than the signature. (Either the clock went backwards, or
+ // an attacker changed the install time in the preferences).
+ if (install_time >= base::Time::Now())
+ return false;
+ return install_time > signature_->timestamp;
+}
+