Stop showing disabled apps in the app launcher and shelf greyed out.
These apps can still be run, they just need to go through an enable
flow.
BUG=321502, 286479
TEST=Check that apps which have been updated in the store to have new
permissions can be launched properly, and are not shown greyed out.
Review URL: https://codereview.chromium.org/81333004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236736 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc
index 1192a0da..fb51962 100644
--- a/chrome/browser/extensions/extension_util.cc
+++ b/chrome/browser/extensions/extension_util.cc
@@ -124,4 +124,17 @@
service->ReloadExtension(extension->id());
}
+bool IsAppLaunchable(const std::string& extension_id,
+ const ExtensionService* service) {
+ return !(service->extension_prefs()->GetDisableReasons(extension_id) &
+ Extension::DISABLE_UNSUPPORTED_REQUIREMENT);
+}
+
+bool IsAppLaunchableWithoutEnabling(const std::string& extension_id,
+ const ExtensionService* service) {
+ const Extension* launchable_extension = service->GetExtensionById(
+ extension_id, ExtensionService::INCLUDE_ENABLED);
+ return launchable_extension != NULL;
+}
+
} // namespace extension_util