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

Side by Side Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 10008084: Add ctrl+drag feature for allowing resizing window with exact positioning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ctrl-drap for resizing window to pixel level. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/multi_window_resize_controller.h" 5 #include "ash/wm/workspace/multi_window_resize_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/root_window_event_filter.h" 9 #include "ash/wm/root_window_event_filter.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; 401 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM;
402 window_resizer_.reset(WorkspaceWindowResizer::Create( 402 window_resizer_.reset(WorkspaceWindowResizer::Create(
403 windows_.window1, parent_location, component, grid_size_, windows)); 403 windows_.window1, parent_location, component, grid_size_, windows));
404 } 404 }
405 405
406 void MultiWindowResizeController::Resize(const gfx::Point& screen_location) { 406 void MultiWindowResizeController::Resize(const gfx::Point& screen_location) {
407 gfx::Point parent_location(screen_location); 407 gfx::Point parent_location(screen_location);
408 aura::Window::ConvertPointToWindow(windows_.window1->GetRootWindow(), 408 aura::Window::ConvertPointToWindow(windows_.window1->GetRootWindow(),
409 windows_.window1->parent(), 409 windows_.window1->parent(),
410 &parent_location); 410 &parent_location);
411 window_resizer_->Drag(parent_location); 411 window_resizer_->Drag(parent_location, 0);
412 gfx::Rect bounds = CalculateResizeWidgetBounds(parent_location); 412 gfx::Rect bounds = CalculateResizeWidgetBounds(parent_location);
413 if (windows_.direction == LEFT_RIGHT) 413 if (windows_.direction == LEFT_RIGHT)
414 bounds.set_y(show_bounds_.y()); 414 bounds.set_y(show_bounds_.y());
415 else 415 else
416 bounds.set_x(show_bounds_.x()); 416 bounds.set_x(show_bounds_.x());
417 resize_widget_->SetBounds(bounds); 417 resize_widget_->SetBounds(bounds);
418 } 418 }
419 419
420 void MultiWindowResizeController::CompleteResize() { 420 void MultiWindowResizeController::CompleteResize() {
421 window_resizer_->CompleteDrag(); 421 window_resizer_->CompleteDrag();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 gfx::Point window_loc(screen_location); 488 gfx::Point window_loc(screen_location);
489 aura::Window::ConvertPointToWindow( 489 aura::Window::ConvertPointToWindow(
490 window->GetRootWindow(), window, &window_loc); 490 window->GetRootWindow(), window, &window_loc);
491 return window->HitTest(window_loc) && 491 return window->HitTest(window_loc) &&
492 window->delegate()->GetNonClientComponent(window_loc) == component; 492 window->delegate()->GetNonClientComponent(window_loc) == component;
493 } 493 }
494 494
495 } // namespace internal 495 } // namespace internal
496 } // namespace ash 496 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698