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

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

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 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
« no previous file with comments | « ash/wm/wm_types.h ('k') | ash/wm/workspace/workspace_event_handler.cc » ('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_util.h" 7 #include "ash/screen_util.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/window_animations.h" 10 #include "ash/wm/window_animations.h"
11 #include "ash/wm/window_state_aura.h"
11 #include "ash/wm/workspace/workspace_event_handler.h" 12 #include "ash/wm/workspace/workspace_event_handler.h"
12 #include "ash/wm/workspace/workspace_window_resizer.h" 13 #include "ash/wm/workspace/workspace_window_resizer.h"
13 #include "grit/ash_resources.h" 14 #include "grit/ash_resources.h"
14 #include "ui/aura/client/screen_position_client.h" 15 #include "ui/aura/client/screen_position_client.h"
15 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
16 #include "ui/aura/window_delegate.h" 17 #include "ui/aura/window_delegate.h"
17 #include "ui/aura/window_event_dispatcher.h" 18 #include "ui/aura/window_event_dispatcher.h"
18 #include "ui/base/hit_test.h" 19 #include "ui/base/hit_test.h"
19 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
20 #include "ui/events/event_targeter.h" 21 #include "ui/events/event_targeter.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 windows.push_back(windows_.window2); 437 windows.push_back(windows_.window2);
437 DCHECK(windows_.other_windows.empty()); 438 DCHECK(windows_.other_windows.empty());
438 FindWindowsTouching(windows_.window2, windows_.direction, 439 FindWindowsTouching(windows_.window2, windows_.direction,
439 &windows_.other_windows); 440 &windows_.other_windows);
440 for (size_t i = 0; i < windows_.other_windows.size(); ++i) { 441 for (size_t i = 0; i < windows_.other_windows.size(); ++i) {
441 windows_.other_windows[i]->AddObserver(this); 442 windows_.other_windows[i]->AddObserver(this);
442 windows.push_back(windows_.other_windows[i]); 443 windows.push_back(windows_.other_windows[i]);
443 } 444 }
444 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM; 445 int component = windows_.direction == LEFT_RIGHT ? HTRIGHT : HTBOTTOM;
445 wm::WindowState* window_state = wm::GetWindowState(windows_.window1); 446 wm::WindowState* window_state = wm::GetWindowState(windows_.window1);
446 window_state->CreateDragDetails(windows_.window1, 447 window_state->CreateDragDetails(location_in_parent, component,
447 location_in_parent,
448 component,
449 aura::client::WINDOW_MOVE_SOURCE_MOUSE); 448 aura::client::WINDOW_MOVE_SOURCE_MOUSE);
450 window_resizer_.reset(WorkspaceWindowResizer::Create(window_state, windows)); 449 window_resizer_.reset(WorkspaceWindowResizer::Create(window_state, windows));
451 450
452 // Do not hide the resize widget while a drag is active. 451 // Do not hide the resize widget while a drag is active.
453 mouse_watcher_.reset(); 452 mouse_watcher_.reset();
454 } 453 }
455 454
456 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen, 455 void MultiWindowResizeController::Resize(const gfx::Point& location_in_screen,
457 int event_flags) { 456 int event_flags) {
458 gfx::Point location_in_parent(location_in_screen); 457 gfx::Point location_in_parent(location_in_screen);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 bool MultiWindowResizeController::IsOverComponent( 573 bool MultiWindowResizeController::IsOverComponent(
575 aura::Window* window, 574 aura::Window* window,
576 const gfx::Point& location_in_screen, 575 const gfx::Point& location_in_screen,
577 int component) const { 576 int component) const {
578 gfx::Point window_loc(location_in_screen); 577 gfx::Point window_loc(location_in_screen);
579 ::wm::ConvertPointFromScreen(window, &window_loc); 578 ::wm::ConvertPointFromScreen(window, &window_loc);
580 return window->delegate()->GetNonClientComponent(window_loc) == component; 579 return window->delegate()->GetNonClientComponent(window_loc) == component;
581 } 580 }
582 581
583 } // namespace ash 582 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/wm_types.h ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698