Commit 1f9feaed authored by Hector Carmona's avatar Hector Carmona Committed by Commit Bot

MD-Extension: Make extension vs app detection logic more robust.

R=scottchen@chromium.org

Bug: NONE
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ic85659a4598037f029f49f3ce073f4b53ac3860f
Reviewed-on: https://chromium-review.googlesource.com/790941Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519768}
parent 6d31045a
...@@ -12,9 +12,17 @@ cr.define('extensions', function() { ...@@ -12,9 +12,17 @@ cr.define('extensions', function() {
* @return {string} The app or extension label depending on |type|. * @return {string} The app or extension label depending on |type|.
*/ */
appOrExtension: function(type, appLabel, extensionLabel) { appOrExtension: function(type, appLabel, extensionLabel) {
return (type == chrome.developerPrivate.ExtensionType.EXTENSION) ? const ExtensionType = chrome.developerPrivate.ExtensionType;
extensionLabel : switch (type) {
appLabel; case ExtensionType.HOSTED_APP:
case ExtensionType.LEGACY_PACKAGED_APP:
case ExtensionType.PLATFORM_APP:
return appLabel;
case ExtensionType.EXTENSION:
case ExtensionType.SHARED_MODULE:
return extensionLabel;
}
assertNotReached('Item type is not App or Extension.');
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment