| Index: chrome/browser/extensions/api/app_window/app_window_api.cc
|
| diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc
|
| index 4f2b68eaf5672670e0a9279fb614087e130a07c2..cc848389ae3249c5c3ac525391cdd87742556994 100644
|
| --- a/chrome/browser/extensions/api/app_window/app_window_api.cc
|
| +++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
|
| @@ -41,6 +41,8 @@ namespace extensions {
|
| namespace app_window_constants {
|
| const char kInvalidWindowId[] =
|
| "The window id can not be more than 256 characters long.";
|
| +const char kMissingPermissionAlphaEnabled[] =
|
| + "The alphaEnabled option requires app.window.alpha permission.";
|
| const char kInvalidColorSpecification[] =
|
| "The color specification could not be parsed.";
|
| const char kInvalidChannelForFrameOptions[] =
|
| @@ -223,12 +225,30 @@ bool AppWindowCreateFunction::RunAsync() {
|
| if (!GetFrameOptions(*options, &create_params))
|
| return false;
|
|
|
| - if (options->transparent_background.get() &&
|
| - (GetExtension()->HasAPIPermission(APIPermission::kExperimental) ||
|
| - CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kEnableExperimentalExtensionApis))) {
|
| - create_params.transparent_background = *options->transparent_background;
|
| +#if defined(USE_AURA)
|
| + if (options->alpha_enabled.get()) {
|
| + bool allow_alpha_enabled = false;
|
| + // For now, continue to support this if Experimental is set (any channel).
|
| + // TODO(garykac) Remove this once the permission moves to stable.
|
| + if (GetExtension()->HasAPIPermission(APIPermission::kExperimental) ||
|
| + CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableExperimentalExtensionApis)) {
|
| + allow_alpha_enabled = true;
|
| + }
|
| + // Support alphaEnabled permission on dev channel.
|
| + if (GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV) {
|
| + if (GetExtension()->HasAPIPermission(APIPermission::kAlphaEnabled)) {
|
| + allow_alpha_enabled = true;
|
| + } else {
|
| + error_ = app_window_constants::kMissingPermissionAlphaEnabled;
|
| + return false;
|
| + }
|
| + }
|
| + if (allow_alpha_enabled) {
|
| + create_params.alpha_enabled = *options->alpha_enabled;
|
| + }
|
| }
|
| +#endif
|
|
|
| if (options->hidden.get())
|
| create_params.hidden = *options->hidden.get();
|
|
|