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

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: Changed as requested 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..3778a80d1da4109c04ab4adb3ff962ab60dba112 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;
@@ -234,6 +235,19 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
workspace_manager()->OnTrackedByWorkspaceChanged(workspace_, window);
}
+ if (key == internal::kWindowCanBeMaximizedByWorkspaceKey &&
+ 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 (old)
+ ash::wm::RestoreWindow(window);
+ else
+ ash::wm::MaximizeWindow(window);
+ }
+
if (key == aura::client::kAlwaysOnTopKey &&
window->GetProperty(aura::client::kAlwaysOnTopKey)) {
internal::AlwaysOnTopController* controller =

Powered by Google App Engine
This is Rietveld 408576698