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

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

Issue 15008002: Make touch-resizing windows to screen edge possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust unit tests with final behavior Created 7 years, 6 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
« no previous file with comments | « ash/wm/window_resizer.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 windows.push_back(windows_.window2); 427 windows.push_back(windows_.window2);
428 DCHECK(windows_.other_windows.empty()); 428 DCHECK(windows_.other_windows.empty());
429 FindWindowsTouching(windows_.window2, windows_.direction, 429 FindWindowsTouching(windows_.window2, windows_.direction,
430 &windows_.other_windows); 430 &windows_.other_windows);
431 for (size_t i = 0; i < windows_.other_windows.size(); ++i) { 431 for (size_t i = 0; i < windows_.other_windows.size(); ++i) {
432 windows_.other_windows[i]->AddObserver(this); 432 windows_.other_windows[i]->AddObserver(this);
433 windows.push_back(windows_.other_windows[i]); 433 windows.push_back(windows_.other_windows[i]);
434 } 434 }
435 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; 435 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM;
436 window_resizer_.reset(WorkspaceWindowResizer::Create( 436 window_resizer_.reset(WorkspaceWindowResizer::Create(
437 windows_.window1, location_in_parent, component, windows)); 437 windows_.window1,
438 location_in_parent,
439 component,
440 aura::client::WINDOW_MOVE_SOURCE_MOUSE,
441 windows));
438 } 442 }
439 443
440 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen, 444 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen,
441 int event_flags) { 445 int event_flags) {
442 gfx::Point location_in_parent(location_in_screen); 446 gfx::Point location_in_parent(location_in_screen);
443 aura::client::GetScreenPositionClient(windows_.window1->GetRootWindow())-> 447 aura::client::GetScreenPositionClient(windows_.window1->GetRootWindow())->
444 ConvertPointFromScreen(windows_.window1->parent(), &location_in_parent); 448 ConvertPointFromScreen(windows_.window1->parent(), &location_in_parent);
445 window_resizer_->Drag(location_in_parent, event_flags); 449 window_resizer_->Drag(location_in_parent, event_flags);
446 gfx::Rect bounds = ScreenAsh::ConvertRectToScreen( 450 gfx::Rect bounds = ScreenAsh::ConvertRectToScreen(
447 windows_.window1->parent(), 451 windows_.window1->parent(),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 536
533 gfx::Point window_loc(location_in_screen); 537 gfx::Point window_loc(location_in_screen);
534 aura::Window::ConvertPointToTarget( 538 aura::Window::ConvertPointToTarget(
535 window->GetRootWindow(), window, &window_loc); 539 window->GetRootWindow(), window, &window_loc);
536 return window->HitTest(window_loc) && 540 return window->HitTest(window_loc) &&
537 window->delegate()->GetNonClientComponent(window_loc) == component; 541 window->delegate()->GetNonClientComponent(window_loc) == component;
538 } 542 }
539 543
540 } // namespace internal 544 } // namespace internal
541 } // namespace ash 545 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_resizer.cc ('k') | ash/wm/workspace/workspace_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698