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

Unified Diff: ash/wm/base_layout_manager.cc

Issue 14273008: Add ash-enable-sticky-edges for 'sticky' instead of 'snap' behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/base_layout_manager.cc
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index d5bb54fa66f3462a9a21c82b16a819cef06cd604..e6fc8333960f4e2f6f869ec112b5ceacb1c8c0d5 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -4,6 +4,7 @@
#include "ash/wm/base_layout_manager.h"
+#include "ash/ash_switches.h"
#include "ash/screen_ash.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shell.h"
@@ -11,6 +12,7 @@
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
+#include "base/command_line.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
@@ -52,10 +54,13 @@ gfx::Rect BaseLayoutManager::BoundsWithScreenEdgeVisible(
const gfx::Rect& restore_bounds) {
gfx::Rect max_bounds =
ash::ScreenAsh::GetMaximizedWindowBoundsInParent(window);
- // If the restore_bounds are more than 1 grid step away from the size the
- // window would be when maximized, inset it.
- max_bounds.Inset(ash::internal::WorkspaceWindowResizer::kScreenEdgeInset,
- ash::internal::WorkspaceWindowResizer::kScreenEdgeInset);
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableStickyEdges)) {
varkha 2013/04/16 02:12:12 This changes the behavior of restore after a norma
stevenjb 2013/04/16 20:08:20 I'm going to revert this until discussing with UX.
+ // If the restore_bounds are more than 1 grid step away from the size the
+ // window would be when maximized, inset it.
+ max_bounds.Inset(ash::internal::WorkspaceWindowResizer::kScreenEdgeInset,
+ ash::internal::WorkspaceWindowResizer::kScreenEdgeInset);
+ }
if (restore_bounds.Contains(max_bounds))
return max_bounds;
return restore_bounds;
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/wm/window_util.h » ('j') | ash/wm/window_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698