| OLD | NEW |
| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 return false; | 445 return false; |
| 446 | 446 |
| 447 // If the window is in the target modal container, only allow the top most | 447 // If the window is in the target modal container, only allow the top most |
| 448 // one. | 448 // one. |
| 449 if (modal_container && modal_container->Contains(window)) | 449 if (modal_container && modal_container->Contains(window)) |
| 450 return modal_layout_manager->IsPartOfActiveModalWindow(window); | 450 return modal_layout_manager->IsPartOfActiveModalWindow(window); |
| 451 | 451 |
| 452 return true; | 452 return true; |
| 453 } | 453 } |
| 454 | 454 |
| 455 WmWindow* RootWindowController::FindEventTarget( | 455 aura::Window* RootWindowController::FindEventTarget( |
| 456 const gfx::Point& location_in_screen) { | 456 const gfx::Point& location_in_screen) { |
| 457 gfx::Point location_in_root(location_in_screen); | 457 gfx::Point location_in_root(location_in_screen); |
| 458 aura::Window* root_window = GetRootWindow(); | 458 aura::Window* root_window = GetRootWindow(); |
| 459 ::wm::ConvertPointFromScreen(root_window, &location_in_root); | 459 ::wm::ConvertPointFromScreen(root_window, &location_in_root); |
| 460 ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root, | 460 ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root, |
| 461 location_in_root, ui::EventTimeForNow(), | 461 location_in_root, ui::EventTimeForNow(), |
| 462 ui::EF_NONE, ui::EF_NONE); | 462 ui::EF_NONE, ui::EF_NONE); |
| 463 ui::EventTarget* event_handler = | 463 ui::EventTarget* event_handler = |
| 464 root_window->GetHost() | 464 root_window->GetHost() |
| 465 ->dispatcher() | 465 ->dispatcher() |
| 466 ->GetDefaultEventTargeter() | 466 ->GetDefaultEventTargeter() |
| 467 ->FindTargetForEvent(root_window, &test_event); | 467 ->FindTargetForEvent(root_window, &test_event); |
| 468 return WmWindow::Get(static_cast<aura::Window*>(event_handler)); | 468 return static_cast<aura::Window*>(event_handler); |
| 469 } | 469 } |
| 470 | 470 |
| 471 gfx::Point RootWindowController::GetLastMouseLocationInRoot() { | 471 gfx::Point RootWindowController::GetLastMouseLocationInRoot() { |
| 472 return window_tree_host_->dispatcher()->GetLastMouseLocationInRoot(); | 472 return window_tree_host_->dispatcher()->GetLastMouseLocationInRoot(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 aura::Window* RootWindowController::GetContainer(int container_id) { | 475 aura::Window* RootWindowController::GetContainer(int container_id) { |
| 476 return GetRootWindow()->GetChildById(container_id); | 476 return GetRootWindow()->GetChildById(container_id); |
| 477 } | 477 } |
| 478 | 478 |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 EnableTouchHudProjection(); | 1083 EnableTouchHudProjection(); |
| 1084 else | 1084 else |
| 1085 DisableTouchHudProjection(); | 1085 DisableTouchHudProjection(); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1088 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
| 1089 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1089 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 } // namespace ash | 1092 } // namespace ash |
| OLD | NEW |