| Index: chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| index ab329550ec8d9540a9bc2f508b24f5c171bdb8cd..3d6d5e812da110a27577486c280f880be51480a9 100644
|
| --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| @@ -7,6 +7,7 @@
|
| #include "apps/native_app_window.h"
|
| #include "apps/shell_window.h"
|
| #include "apps/shell_window_registry.h"
|
| +#include "ash/ash_switches.h"
|
| #include "ash/host/root_window_host_factory.h"
|
| #include "ash/magnifier/magnifier_constants.h"
|
| #include "ash/session_state_delegate.h"
|
| @@ -24,6 +25,7 @@
|
| #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
|
| #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h"
|
| #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h"
|
| +#include "chrome/browser/ui/ash/ash_util.h"
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
|
| #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h"
|
| #include "chrome/browser/ui/ash/user_action_handler.h"
|
| @@ -175,20 +177,17 @@ void ChromeShellDelegate::ToggleFullscreen() {
|
| return;
|
| }
|
|
|
| - // AppNonClientFrameViewAsh shows only the window controls and no other
|
| + // AppBrowserFrameViewAsh shows only the window controls and no other
|
| // window decorations which is pretty close to fullscreen. Put v1 apps
|
| // into maximized mode instead of fullscreen to avoid showing the ugly
|
| // fullscreen exit bubble.
|
| -#if defined(OS_WIN)
|
| - if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) {
|
| - chrome::ToggleFullscreenMode(browser);
|
| - return;
|
| - }
|
| -#endif // OS_WIN
|
| - if (browser->is_app() && browser->app_type() != Browser::APP_TYPE_CHILD)
|
| + if (chrome::IsNativeViewInAsh(window) &&
|
| + browser->is_app() &&
|
| + browser->app_type() != Browser::APP_TYPE_CHILD) {
|
| window_state->ToggleMaximized();
|
| - else
|
| + } else {
|
| chrome::ToggleFullscreenMode(browser);
|
| + }
|
| return;
|
| }
|
|
|
| @@ -196,10 +195,18 @@ void ChromeShellDelegate::ToggleFullscreen() {
|
| apps::ShellWindow* shell_window = apps::ShellWindowRegistry::
|
| GetShellWindowForNativeWindowAnyProfile(window);
|
| if (shell_window) {
|
| - if (is_fullscreen)
|
| + if (is_fullscreen) {
|
| shell_window->Restore();
|
| - else
|
| + } else if (chrome::IsNativeViewInAsh(window) &&
|
| + ash::switches::UseSameFrameForV1AndV2Apps()) {
|
| + // AppNonClientFrameViewAsh shows only the window controls and no other
|
| + // window decorations which is close to fullscreen and is more useful than
|
| + // fullscreen. Put shell windows into maximized mode instead of
|
| + // fullscreen.
|
| + shell_window->Maximize();
|
| + } else {
|
| shell_window->Fullscreen();
|
| + }
|
| }
|
| }
|
|
|
|
|