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

Side by Side Diff: chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/app_current_window_internal/app_current_ window_internal_api.h" 5 #include "chrome/browser/extensions/api/app_current_window_internal/app_current_ window_internal_api.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 namespace app_current_window_internal = 21 namespace app_current_window_internal =
22 extensions::api::app_current_window_internal; 22 extensions::api::app_current_window_internal;
23 23
24 namespace Show = app_current_window_internal::Show; 24 namespace Show = app_current_window_internal::Show;
25 namespace SetBounds = app_current_window_internal::SetBounds; 25 namespace SetBounds = app_current_window_internal::SetBounds;
26 namespace SetSizeConstraints = app_current_window_internal::SetSizeConstraints; 26 namespace SetSizeConstraints = app_current_window_internal::SetSizeConstraints;
27 namespace SetIcon = app_current_window_internal::SetIcon; 27 namespace SetIcon = app_current_window_internal::SetIcon;
28 namespace SetBadgeIcon = app_current_window_internal::SetBadgeIcon; 28 namespace SetBadgeIcon = app_current_window_internal::SetBadgeIcon;
29 namespace SetShape = app_current_window_internal::SetShape; 29 namespace SetShape = app_current_window_internal::SetShape;
30 namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop; 30 namespace SetAlwaysOnTop = app_current_window_internal::SetAlwaysOnTop;
31 namespace SetVisibleOnAllWorkspaces =
32 app_current_window_internal::SetVisibleOnAllWorkspaces;
31 33
32 using apps::AppWindow; 34 using apps::AppWindow;
33 using app_current_window_internal::Bounds; 35 using app_current_window_internal::Bounds;
34 using app_current_window_internal::Region; 36 using app_current_window_internal::Region;
35 using app_current_window_internal::RegionRect; 37 using app_current_window_internal::RegionRect;
36 using app_current_window_internal::SizeConstraints; 38 using app_current_window_internal::SizeConstraints;
37 39
38 namespace extensions { 40 namespace extensions {
39 41
40 namespace { 42 namespace {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 return false; 395 return false;
394 } 396 }
395 397
396 scoped_ptr<SetAlwaysOnTop::Params> params( 398 scoped_ptr<SetAlwaysOnTop::Params> params(
397 SetAlwaysOnTop::Params::Create(*args_)); 399 SetAlwaysOnTop::Params::Create(*args_));
398 CHECK(params.get()); 400 CHECK(params.get());
399 window->SetAlwaysOnTop(params->always_on_top); 401 window->SetAlwaysOnTop(params->always_on_top);
400 return true; 402 return true;
401 } 403 }
402 404
405 bool AppCurrentWindowInternalSetVisibleOnAllWorkspacesFunction::RunWithWindow(
406 AppWindow* window) {
407 if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) {
benwells 2014/08/20 05:02:08 Can we use the feature system to enforce this?
jackhou1 2014/08/27 05:10:45 We can for chrome.app.window.canSetVisibleOnAllWor
408 error_ = kDevChannelOnly;
409 return false;
410 }
411
412 scoped_ptr<SetVisibleOnAllWorkspaces::Params> params(
413 SetVisibleOnAllWorkspaces::Params::Create(*args_));
414 CHECK(params.get());
415 window->GetBaseWindow()->SetVisibleOnAllWorkspaces(params->always_visible);
416 return true;
417 }
418
403 } // namespace extensions 419 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698