Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1116)

Unified Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 375183002: Add app.window.alphaEnabled() and onAlphaEnabledChanged. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pipe CanHaveAlphaEnabled through Widget. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 199fbf4b9afcf5c70f65f9c120e15ee1d71df112..4c117501ad1bd2fcef519046d740e86469d1a833 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -54,6 +54,8 @@ const char kAlwaysOnTopPermission[] =
"The \"app.window.alwaysOnTop\" permission is required.";
const char kInvalidUrlParameter[] =
"The URL used for window creation must be local for security reasons.";
+const char kTransparentBackgroundNeedsFrameNone[] =
+ "\"transparent_background\" can only be used with \"frame: none\".";
} // namespace app_window_constants
const char kNoneFrameOption[] = "none";
@@ -232,12 +234,17 @@ bool AppWindowCreateFunction::RunAsync() {
if (!GetFrameOptions(*options, &create_params))
return false;
- if (options->transparent_background.get() &&
- (GetExtension()->permissions_data()->HasAPIPermission(
- APIPermission::kExperimental) ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalExtensionApis))) {
- create_params.transparent_background = *options->transparent_background;
+ if (options->transparent_background.get()) {
+ if (create_params.frame != AppWindow::FRAME_NONE) {
+ error_ = app_window_constants::kTransparentBackgroundNeedsFrameNone;
+ return false;
+ }
+ if (GetExtension()->permissions_data()->HasAPIPermission(
+ APIPermission::kExperimental) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalExtensionApis)) {
+ create_params.transparent_background = *options->transparent_background;
+ }
levin 2014/07/15 20:40:05 Changes in this file seem unrelated to the rest of
jackhou1 2014/07/16 01:26:29 Seems fair, the feature is still behind a flag aft
}
if (options->hidden.get())

Powered by Google App Engine
This is Rietveld 408576698