#include "ash/wm/window_state_util.h"
#include "ash/public/cpp/window_animation_types.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_state_delegate.h"
#include "ui/wm/core/window_util.h"
namespace ash {
void ToggleFullScreen(WindowState* window_state,
WindowStateDelegate* delegate) {
bool is_fullscreen = window_state->IsFullscreen();
if (!is_fullscreen && !window_state->CanMaximize()) {
wm::AnimateWindow(window_state->window(), wm::WINDOW_ANIMATION_TYPE_BOUNCE);
return;
}
if (delegate && delegate->ToggleFullscreen(window_state))
return;
::wm::SetWindowFullscreen(window_state->window(), !is_fullscreen);
}
}