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

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

Issue 469993003: Add AppWindow.setVisibleOnAllWorkspaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 6 years, 4 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 767f2f0c2d4cb8c9a17f56cdb7977bf897073267..fe9f4b1a30e9d0347d95bf205273560203f3173c 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -56,6 +56,8 @@ const char kAlphaEnabledMissingPermission[] =
"The alphaEnabled option requires app.window.alpha permission.";
const char kAlphaEnabledNeedsFrameNone[] =
"The alphaEnabled option can only be used with \"frame: 'none'\".";
+const char kVisibleOnAllWorkspacesWrongChannel[] =
+ "The visibleOnAllWorkspaces option requires dev channel or newer.";
} // namespace app_window_constants
const char kNoneFrameOption[] = "none";
@@ -257,6 +259,15 @@ bool AppWindowCreateFunction::RunAsync() {
if (options->focused.get())
create_params.focused = *options->focused.get();
+ if (options->visible_on_all_workspaces.get()) {
+ if (AppsClient::Get()->IsCurrentChannelOlderThanDev()) {
+ error_ = app_window_constants::kVisibleOnAllWorkspacesWrongChannel;
+ return false;
+ }
+ create_params.visible_on_all_workspaces =
+ *options->visible_on_all_workspaces.get();
+ }
+
if (options->type != extensions::api::app_window::WINDOW_TYPE_PANEL) {
switch (options->state) {
case extensions::api::app_window::STATE_NONE:

Powered by Google App Engine
This is Rietveld 408576698