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

Unified Diff: ash/wm/window_state_util.cc

Issue 247363005: Fullscreen/immersive mode is allowed in touch view mode, the shelf gets hidden and an edge swipe br… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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
« no previous file with comments | « ash/wm/window_state_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state_util.cc
diff --git a/ash/wm/window_state_util.cc b/ash/wm/window_state_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e5d6f8e1cdd9cf4c3207e3cb1c805c9232712e53
--- /dev/null
+++ b/ash/wm/window_state_util.cc
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/wm/window_state_util.h"
+
+#include "ash/wm/window_state.h"
+#include "ash/wm/window_state_delegate.h"
+#include "ui/aura/client/aura_constants.h"
+
+namespace ash {
+namespace wm {
+
+void ToggleFullScreen(wm::WindowState* window_state,
+ WindowStateDelegate* delegate) {
+ // Window which cannot be maximized should not be full screen'ed.
+ // It can, however, be restored if it was full screen'ed.
+ bool is_fullscreen = window_state->IsFullscreen();
+ if (!is_fullscreen && !window_state->CanMaximize())
+ return;
+
+ if (delegate && delegate->ToggleFullscreen(window_state))
+ return;
+
+ if (is_fullscreen) {
+ window_state->Restore();
+ } else {
+ // Set the property to activate full screen.
+ window_state->window()->SetProperty(aura::client::kShowStateKey,
+ ui::SHOW_STATE_FULLSCREEN);
+ }
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/window_state_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698