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

Unified Diff: ash/common/wm_root_window_controller.cc

Issue 2624613002: Promotes common functions to WmRootWindowController (Closed)
Patch Set: order Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/wm_root_window_controller.h ('k') | ash/mus/bridge/wm_root_window_controller_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c3207c18f8c9077bbfca1b0cf80201adab6fc6b6 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));
+}
+
+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));
+}
+
+gfx::Point WmRootWindowController::GetLastMouseLocationInRoot() {
+ return WmWindowAura::GetAuraWindow(GetWindow())
+ ->GetHost()
+ ->dispatcher()
+ ->GetLastMouseLocationInRoot();
+}
+
void WmRootWindowController::ShowContextMenu(
const gfx::Point& location_in_screen,
ui::MenuSourceType source_type) {
« no previous file with comments | « ash/common/wm_root_window_controller.h ('k') | ash/mus/bridge/wm_root_window_controller_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698