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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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
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"
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 return false; 542 return false;
543 } 543 }
544 } 544 }
545 545
546 // Check whether |location_in_screen| is in the event target's resize region. 546 // Check whether |location_in_screen| is in the event target's resize region.
547 // This is tricky because a window's resize region can extend outside a 547 // This is tricky because a window's resize region can extend outside a
548 // window's bounds. 548 // window's bounds.
549 gfx::Point location_in_root(location_in_screen); 549 gfx::Point location_in_root(location_in_screen);
550 aura::Window* root = windows_.window1->GetRootWindow(); 550 aura::Window* root = windows_.window1->GetRootWindow();
551 ::wm::ConvertPointFromScreen(root, &location_in_root); 551 ::wm::ConvertPointFromScreen(root, &location_in_root);
552 ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root, 552 ui::MouseEvent test_event(
553 location_in_root, ui::EventTimeForNow(), 553 ui::ET_MOUSE_MOVED, location_in_root, location_in_root,
554 ui::EF_NONE, ui::EF_NONE); 554 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
555 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
555 ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root) 556 ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root)
556 ->GetEventTargeter() 557 ->GetEventTargeter()
557 ->FindTargetForEvent(root, &test_event); 558 ->FindTargetForEvent(root, &test_event);
558 if (event_handler == windows_.window1) { 559 if (event_handler == windows_.window1) {
559 return IsOverComponent( 560 return IsOverComponent(
560 windows_.window1, 561 windows_.window1,
561 location_in_screen, 562 location_in_screen,
562 windows_.direction == TOP_BOTTOM ? HTBOTTOM : HTRIGHT); 563 windows_.direction == TOP_BOTTOM ? HTBOTTOM : HTRIGHT);
563 } else if (event_handler == windows_.window2) { 564 } else if (event_handler == windows_.window2) {
564 return IsOverComponent( 565 return IsOverComponent(
565 windows_.window2, 566 windows_.window2,
566 location_in_screen, 567 location_in_screen,
567 windows_.direction == TOP_BOTTOM ? HTTOP : HTLEFT); 568 windows_.direction == TOP_BOTTOM ? HTTOP : HTLEFT);
568 } 569 }
569 return false; 570 return false;
570 } 571 }
571 572
572 bool MultiWindowResizeController::IsOverComponent( 573 bool MultiWindowResizeController::IsOverComponent(
573 aura::Window* window, 574 aura::Window* window,
574 const gfx::Point& location_in_screen, 575 const gfx::Point& location_in_screen,
575 int component) const { 576 int component) const {
576 gfx::Point window_loc(location_in_screen); 577 gfx::Point window_loc(location_in_screen);
577 ::wm::ConvertPointFromScreen(window, &window_loc); 578 ::wm::ConvertPointFromScreen(window, &window_loc);
578 return window->delegate()->GetNonClientComponent(window_loc) == component; 579 return window->delegate()->GetNonClientComponent(window_loc) == component;
579 } 580 }
580 581
581 } // namespace ash 582 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698