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

Unified Diff: ash/wm/window_util.cc

Issue 2904273002: [mus+ash] Removes WmWindow from RootWindowcontroller implementation (Closed)
Patch Set: [mus+ash] Removes WmWindow from RootWindowcontroller implementation (rebased) Created 3 years, 7 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/wm/window_util.h ('k') | ash/wm_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 6c033a6bf7bccd6448e867c3f6eb7101fdaa6715..b1bba1c18985b55c02017a6152b8cf1b1833c3af 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -31,6 +31,7 @@
#include "ui/gfx/geometry/size.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/easy_resize_window_targeter.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_client.h"
@@ -145,6 +146,27 @@ int GetNonClientComponent(aura::Window* window, const gfx::Point& location) {
: HTNOWHERE;
}
+void SetChildrenUseExtendedHitRegionForWindow(aura::Window* window) {
+ window->SetProperty(kChildrenUseExtendedHitRegion, true);
+ gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize,
+ -kResizeOutsideBoundsSize);
+ gfx::Insets touch_extend =
+ mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch);
+ // TODO: EasyResizeWindowTargeter makes it so children get events outside
+ // their bounds. This only works in mash when mash is providing the non-client
+ // frame. Mus needs to support an api for the WindowManager that enables
+ // events to be dispatched to windows outside the windows bounds that this
+ // function calls into. http://crbug.com/679056.
+ window->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>(
+ window, mouse_extend, touch_extend));
+}
+
+bool ShouldUseExtendedHitRegionForWindow(const aura::Window* window) {
+ const aura::Window* parent = window->parent();
+ return parent && parent->GetProperty(kChildrenUseExtendedHitRegion);
+}
+
void CloseWidgetForWindow(aura::Window* window) {
if (Shell::GetAshConfig() == Config::MASH &&
window->GetProperty(kWidgetCreationTypeKey) ==
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698