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(); |