Chromium Code Reviews| Index: ash/wm/window_util.cc |
| diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc |
| index 481a27cbc8a2bba583409e0afe69fd52cba5bf3e..7f41badf1e93f6feb9004ebc6850719fbc032bc8 100644 |
| --- a/ash/wm/window_util.cc |
| +++ b/ash/wm/window_util.cc |
| @@ -7,11 +7,14 @@ |
| #include <vector> |
| #include "ash/ash_constants.h" |
| +#include "ash/ash_switches.h" |
| #include "ash/root_window_controller.h" |
| #include "ash/shell.h" |
| #include "ash/shell_window_ids.h" |
| #include "ash/wm/activation_controller.h" |
| #include "ash/wm/window_properties.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" |
| @@ -25,6 +28,14 @@ |
| #include "ui/views/view.h" |
| #include "ui/views/widget/widget.h" |
| +namespace { |
| + |
| +// Number of pixels of mouse movement required before windows drag or resize |
| +// beyond the edge of a workspace. |
| +const int kWindowStickySize = 64; |
| + |
| +} |
| + |
| namespace ash { |
| namespace wm { |
| @@ -218,5 +229,17 @@ bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) { |
| return true; |
| } |
| +bool ShouldStickToEdge(int distance_from_edge) { |
| + if (CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kAshEnableStickyEdges)) { |
| + return distance_from_edge < 0 && |
| + distance_from_edge > -kWindowStickySize; |
| + } else { |
| + const int sticky_size = internal::WorkspaceWindowResizer::kScreenEdgeInset; |
|
flackr
2013/04/16 00:32:14
Assuming this method stays here we should probably
stevenjb
2013/04/16 20:08:20
Moved back.
|
| + return distance_from_edge < sticky_size && |
| + distance_from_edge > -sticky_size * 2; |
| + } |
| +} |
| + |
| } // namespace wm |
| } // namespace ash |