Chromium Code Reviews| Index: ash/common/wm_root_window_controller.cc |
| diff --git a/ash/common/wm_root_window_controller.cc b/ash/common/wm_root_window_controller.cc |
| index f2851f6ac646bf4e8585bb61907f301b00bdac32..beb5808d4c93ec333953b86cb4ce0e26df6d0915 100644 |
| --- a/ash/common/wm_root_window_controller.cc |
| +++ b/ash/common/wm_root_window_controller.cc |
| @@ -4,6 +4,7 @@ |
| #include "ash/common/wm_root_window_controller.h" |
| +#include "ash/aura/wm_window_aura.h" |
| #include "ash/common/session/session_state_delegate.h" |
| #include "ash/common/shelf/shelf_layout_manager.h" |
| #include "ash/common/shelf/shelf_widget.h" |
| @@ -27,7 +28,12 @@ |
| #include "ash/common/wm_window.h" |
| #include "ash/public/cpp/shell_window_ids.h" |
| #include "base/memory/ptr_util.h" |
| +#include "ui/aura/window.h" |
| +#include "ui/aura/window_event_dispatcher.h" |
| +#include "ui/aura/window_tree_host.h" |
| #include "ui/base/models/menu_model.h" |
| +#include "ui/events/event_targeter.h" |
| +#include "ui/events/event_utils.h" |
| #include "ui/views/controls/menu/menu_model_adapter.h" |
| #include "ui/views/controls/menu/menu_runner.h" |
| @@ -230,6 +236,35 @@ const WmWindow* WmRootWindowController::GetContainer(int container_id) const { |
| return root_->GetChildByShellWindowId(container_id); |
| } |
| +void WmRootWindowController::ConfigureWidgetInitParamsForContainer( |
| + views::Widget* widget, |
| + int shell_container_id, |
| + views::Widget::InitParams* init_params) { |
| + init_params->parent = WmWindowAura::GetAuraWindow( |
| + GetWindow()->GetChildByShellWindowId(shell_container_id)); |
| +} |
| + |
| +gfx::Point WmRootWindowController::GetLastMouseLocationInRoot() { |
|
msw
2017/01/09 23:26:48
nit: match function decl order
sky
2017/01/09 23:39:11
Done.
|
| + return WmWindowAura::GetAuraWindow(GetWindow()) |
| + ->GetHost() |
| + ->dispatcher() |
| + ->GetLastMouseLocationInRoot(); |
| +} |
| + |
| +WmWindow* WmRootWindowController::FindEventTarget( |
| + const gfx::Point& location_in_screen) { |
| + gfx::Point location_in_root = |
| + GetWindow()->ConvertPointFromScreen(location_in_screen); |
| + aura::Window* root = WmWindowAura::GetAuraWindow(GetWindow()); |
| + ui::MouseEvent test_event(ui::ET_MOUSE_MOVED, location_in_root, |
| + location_in_root, ui::EventTimeForNow(), |
| + ui::EF_NONE, ui::EF_NONE); |
| + ui::EventTarget* event_handler = static_cast<ui::EventTarget*>(root) |
| + ->GetEventTargeter() |
| + ->FindTargetForEvent(root, &test_event); |
| + return WmWindowAura::Get(static_cast<aura::Window*>(event_handler)); |
| +} |
| + |
| void WmRootWindowController::ShowContextMenu( |
| const gfx::Point& location_in_screen, |
| ui::MenuSourceType source_type) { |