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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 17515005: Do not put v1 app windows or popup windows into immersive fullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed maximize behavior for task manager to be consistent with how F11 works on other platforms Created 7 years, 6 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/accelerators/accelerator_table.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5b7cecccff622e619591bd6fb5cb02acea749a9d..168ae3a90eb0baa860cdb9d3130f3cff3719e5c9 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();
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698