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

Unified Diff: apps/app_window_contents.cc

Issue 59043013: Add flag to enable immersive fullscreen for v2 apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | apps/shell_window.h » ('j') | apps/shell_window.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_window_contents.cc
diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc
index 751ccc2d3535152d0e65a6e01c14455e372bb777..1b6dcdd7f1739267b0af13a6a020f929698bac4b 100644
--- a/apps/app_window_contents.cc
+++ b/apps/app_window_contents.cc
@@ -94,11 +94,26 @@ void AppWindowContents::NativeWindowChanged(
update.width.reset(new int(bounds.width()));
update.height.reset(new int(bounds.height()));
dictionary->Set("bounds", update.ToValue().release());
- dictionary->SetBoolean("fullscreen",
- native_app_window->IsFullscreenOrPending());
- dictionary->SetBoolean("minimized", native_app_window->IsMinimized());
- dictionary->SetBoolean("maximized", native_app_window->IsMaximized());
dictionary->SetBoolean("alwaysOnTop", native_app_window->IsAlwaysOnTop());
+ dictionary->SetBoolean("minimized", native_app_window->IsMinimized());
+
+ bool maximized = native_app_window->IsMaximized();
+ ShellWindow::FullscreenType fullscreen_type = host_->fullscreen_type();
+ // Check both the fullscreen type and |native_app_window| so that the window
+ // is reported as fullscreen if the fullscreen state lags behind that of
+ // ShellWindow. (This is the case in the GTK port).
+ bool fullscreen = (fullscreen_type != ShellWindow::FULLSCREEN_TYPE_NONE) ||
+ native_app_window->IsFullscreen();
+ if (fullscreen_type == ShellWindow::FULLSCREEN_TYPE_IMMERSIVE) {
+ // A window in immersive fullscreen on ChromeOS does not take up all of the
+ // pixels on screen because the shelf is auto hidden, not completely hidden.
+ // For this reason, immersive fullscreen windows are considered maximized
+ // for the sake of the app.window api.
+ fullscreen = false;
+ maximized = true;
+ }
+ dictionary->SetBoolean("fullscreen", fullscreen);
+ dictionary->SetBoolean("maximized", maximized);
const ShellWindow::SizeConstraints& size_constraints =
host_->size_constraints();
« no previous file with comments | « no previous file | apps/shell_window.h » ('j') | apps/shell_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698