summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension.cc
diff options
context:
space:
mode:
authorelijahtaylor <elijahtaylor@chromium.org>2014-12-04 16:42:20 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-05 00:42:52 +0000
commit89b02d7db9f1d1f98f65040535b5acc59aadaab0 (patch)
tree80bc26ffcfbaa27a343308f0cc66964ae213914e /extensions/common/extension.cc
parent98b0a9fedb5048675d589898a9c1a7851e864bbe (diff)
downloadchromium_src-89b02d7db9f1d1f98f65040535b5acc59aadaab0.zip
chromium_src-89b02d7db9f1d1f98f65040535b5acc59aadaab0.tar.gz
chromium_src-89b02d7db9f1d1f98f65040535b5acc59aadaab0.tar.bz2
Add "version_name" field to extensions
BUG=428973 Review URL: https://codereview.chromium.org/777973002 Cr-Commit-Position: refs/heads/master@{#306944}
Diffstat (limited to 'extensions/common/extension.cc')
-rw-r--r--extensions/common/extension.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index d8e798e..88cc084 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -384,6 +384,12 @@ const std::string Extension::VersionString() const {
return version()->GetString();
}
+const std::string Extension::GetVersionForDisplay() const {
+ if (version_name_.size() > 0)
+ return version_name_;
+ return VersionString();
+}
+
void Extension::AddInstallWarning(const InstallWarning& new_warning) {
install_warnings_.push_back(new_warning);
}
@@ -569,6 +575,12 @@ bool Extension::LoadVersion(base::string16* error) {
*error = base::ASCIIToUTF16(errors::kInvalidVersion);
return false;
}
+ if (manifest_->HasKey(keys::kVersionName)) {
+ if (!manifest_->GetString(keys::kVersionName, &version_name_)) {
+ *error = base::ASCIIToUTF16(errors::kInvalidVersionName);
+ return false;
+ }
+ }
return true;
}