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

Unified Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 13934007: Adding experimental maximize mode (behind a flag) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Step back and a few changes Created 7 years, 8 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
Index: ash/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 65ed116b24261cf04babe85e815197cb5f5eaba8..82f9464d97a59e41d3a301eab270d62a400a3e39 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -24,6 +24,7 @@
#include "ui/aura/window_observer.h"
#include "ui/base/events/event.h"
#include "ui/base/ui_base_types.h"
+#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/views/corewm/window_util.h"
using aura::Window;
@@ -170,6 +171,22 @@ void WorkspaceLayoutManager::OnDisplayWorkAreaInsetsChanged() {
void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
const void* key,
intptr_t old) {
+ if (key == ash::internal::kWindowPersistsAcrossAllWorkspacesKey &&
sky 2013/05/01 04:32:04 I don't think you intended to keep this.
Mr4D (OOO till 08-26) 2013/05/01 17:57:23 Ahh. No problem. Removed and reverted back to what
+ ash::Shell::IsForcedMaximizeMode()) {
+ // Since this flag can only be set after creation, but it is not dynamic,
+ // we want this flag to be executed immediately without animations.
+ scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration(
+ new ui::ScopedAnimationDurationScaleMode(
+ ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
+ if (GetPersistsAcrossAllWorkspaces(window)) {
+ if (wm::IsWindowMaximized(window))
+ wm::RestoreWindow(window);
+ } else {
+ if (!wm::IsWindowMaximized(window))
+ wm::MaximizeWindow(window);
+ }
+ }
+
if (key == aura::client::kShowStateKey) {
ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old);
ui::WindowShowState new_state =

Powered by Google App Engine
This is Rietveld 408576698