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

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

Issue 25536010: Make packaged apps use AppNonClientFrameViewAsh when maximized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | « chrome/browser/about_flags.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 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();
+ }
}
}
« no previous file with comments | « chrome/browser/about_flags.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