Commit e1f5f233 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Allow whitelisted component extensions to always run in signed out profile

Bug: 946839
Change-Id: I9835ca0e969844e1a9a95ba0fb6b5422d7fc48bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542616
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645352}
parent 35ebae92
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#endif #endif
...@@ -82,8 +83,9 @@ bool ChromeProcessManagerDelegate::IsExtensionBackgroundPageAllowed( ...@@ -82,8 +83,9 @@ bool ChromeProcessManagerDelegate::IsExtensionBackgroundPageAllowed(
->GetForceInstallList(); ->GetForceInstallList();
// For the ChromeOS login profile, only allow apps installed by device // For the ChromeOS login profile, only allow apps installed by device
// policy. // policy or that are explicitly whitelisted.
return login_screen_apps_list->HasKey(extension.id()); return login_screen_apps_list->HasKey(extension.id()) ||
IsComponentExtensionWhitelistedForSignInProfile(extension.id());
} }
if (chromeos::ProfileHelper::IsLockScreenAppProfile(profile) && if (chromeos::ProfileHelper::IsLockScreenAppProfile(profile) &&
......
...@@ -112,4 +112,24 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) { ...@@ -112,4 +112,24 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
return false; return false;
} }
#if defined(OS_CHROMEOS)
bool IsComponentExtensionWhitelistedForSignInProfile(
const std::string& extension_id) {
const char* const kAllowed[] = {
extension_misc::kChromeVoxExtensionId,
extension_misc::kEspeakSpeechSynthesisExtensionId,
extension_misc::kGoogleSpeechSynthesisExtensionId,
extension_misc::kSelectToSpeakExtensionId,
extension_misc::kSwitchAccessExtensionId,
};
for (size_t i = 0; i < base::size(kAllowed); ++i) {
if (extension_id == kAllowed[i])
return true;
}
return false;
}
#endif
} // namespace extensions } // namespace extensions
...@@ -42,6 +42,12 @@ bool IsComponentExtensionWhitelisted(const std::string& extension_id); ...@@ -42,6 +42,12 @@ bool IsComponentExtensionWhitelisted(const std::string& extension_id);
// Checks using resource ID of manifest. // Checks using resource ID of manifest.
bool IsComponentExtensionWhitelisted(int manifest_resource_id); bool IsComponentExtensionWhitelisted(int manifest_resource_id);
#if defined(OS_CHROMEOS)
// Checks using extension id for sign in profile.
bool IsComponentExtensionWhitelistedForSignInProfile(
const std::string& extension_id);
#endif
} // namespace extensions } // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_WHITELIST_WHITELIST_H_ #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_WHITELIST_WHITELIST_H_
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