From 821bbbcbc459302f4c511c9d9f0ad93e4db09e8a Mon Sep 17 00:00:00 2001 From: "pkotwicz@chromium.org" Date: Fri, 21 Jun 2013 20:06:38 +0000 Subject: This CL does the following - puts browser windows which would have used AppNonClientFrameViewAsh into maximized mode - puts v1 app windows which would not have used AppNonClientFrameViewAsh and browser popup windows into tab fullscreen - Makes Alt+ put windows into maximized mode. (That's what Ctrl+Alt+? indicates) TEST=ChromeShellDelegateBrowserTest BUG=251311 Review URL: https://chromiumcodereview.appspot.com/17515005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207910 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/ash/chrome_shell_delegate.cc | 30 ++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to '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 5b7cecc..168ae3a 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -159,12 +159,31 @@ void ChromeShellDelegate::ToggleFullscreen() { bool is_fullscreen = ash::wm::IsWindowFullscreen(window); // Windows which cannot be maximized should not be fullscreened. - if (is_fullscreen && !ash::wm::CanMaximizeWindow(window)) + if (!is_fullscreen && !ash::wm::CanMaximizeWindow(window)) return; Browser* browser = chrome::FindBrowserWithWindow(window); if (browser) { - chrome::ToggleFullscreenMode(browser); + // If a window is fullscreen, exit fullscreen. + if (is_fullscreen) { + chrome::ToggleFullscreenMode(browser); + return; + } + + // AppNonClientFrameViewAsh 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) + ash::wm::ToggleMaximizedWindow(window); + else + chrome::ToggleFullscreenMode(browser); return; } @@ -185,13 +204,6 @@ void ChromeShellDelegate::ToggleMaximized() { if (!window) return; - // TODO(pkotwicz): If immersive mode replaces fullscreen, bind fullscreen to - // F4 and find a different key binding for maximize. - if (ImmersiveFullscreenConfiguration::UseImmersiveFullscreen()) { - ToggleFullscreen(); - return; - } - // Get out of fullscreen when in fullscreen mode. if (ash::wm::IsWindowFullscreen(window)) { ToggleFullscreen(); -- cgit v1.1