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

Unified Diff: ash/wm/default_window_resizer.cc

Issue 10910164: Removes the grid from ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ShelfBrowserTest Created 8 years, 3 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
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/gestures/system_pinch_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/default_window_resizer.cc
diff --git a/ash/wm/default_window_resizer.cc b/ash/wm/default_window_resizer.cc
index 4283994a1e65feeb21d7237d110368a2a5e368f4..50cac97ec88565457538334325e3eb6541d979ae 100644
--- a/ash/wm/default_window_resizer.cc
+++ b/ash/wm/default_window_resizer.cc
@@ -14,8 +14,6 @@
#include "ui/aura/window_delegate.h"
#include "ui/base/hit_test.h"
#include "ui/base/ui_base_types.h"
-#include "ui/compositor/layer.h"
-#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/screen.h"
namespace ash {
@@ -42,9 +40,7 @@ void DefaultWindowResizer::Drag(const gfx::Point& location, int event_flags) {
if (current_root != details_.window->GetRootWindow())
return;
- int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
- 0 : ash::Shell::GetInstance()->GetGridSize();
- gfx::Rect bounds(CalculateBoundsForDrag(details_, location, grid_size));
+ gfx::Rect bounds(CalculateBoundsForDrag(details_, location));
if (bounds != details_.window->bounds()) {
did_move_or_resize_ = true;
details_.window->SetBounds(bounds);
@@ -52,26 +48,6 @@ void DefaultWindowResizer::Drag(const gfx::Point& location, int event_flags) {
}
void DefaultWindowResizer::CompleteDrag(int event_flags) {
- int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
- 0 : ash::Shell::GetInstance()->GetGridSize();
- if (grid_size <= 1 || !did_move_or_resize_)
- return;
- gfx::Rect new_bounds(
- AdjustBoundsToGrid(details_.window->bounds(), grid_size));
- if (new_bounds == details_.window->bounds())
- return;
-
- if (new_bounds.size() != details_.window->bounds().size()) {
- // Don't attempt to animate a size change.
- details_.window->SetBounds(new_bounds);
- return;
- }
-
- ui::ScopedLayerAnimationSettings scoped_setter(
- details_.window->layer()->GetAnimator());
- // Use a small duration since the grid is small.
- scoped_setter.SetTransitionDuration(base::TimeDelta::FromMilliseconds(100));
- details_.window->SetBounds(new_bounds);
}
void DefaultWindowResizer::RevertDrag() {
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/gestures/system_pinch_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698