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

Unified Diff: components/mus/example/wm/move_loop.cc

Issue 1419793006: Makes windowmanager draw non-client area (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add include Created 5 years, 1 month 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 | « components/mus/example/wm/BUILD.gn ('k') | components/mus/example/wm/move_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/example/wm/move_loop.cc
diff --git a/components/mus/example/wm/move_loop.cc b/components/mus/example/wm/move_loop.cc
index 28e33bc84994f5dc9746ba14235a4eeadab8af25..926855e9bd99a4cc77da7b97735b5a84362e3ac8 100644
--- a/components/mus/example/wm/move_loop.cc
+++ b/components/mus/example/wm/move_loop.cc
@@ -31,6 +31,12 @@ mus::mojom::EventFlags MouseOnlyEventFlags(mus::mojom::EventFlags flags) {
mus::mojom::EVENT_FLAGS_RIGHT_MOUSE_BUTTON));
}
+gfx::Rect ClientAreaBounds(const mus::Window* window) {
+ gfx::Rect client_area(window->bounds().size());
+ client_area.Inset(window->client_area());
+ return client_area;
+}
+
} // namespace
MoveLoop::~MoveLoop() {
@@ -44,7 +50,7 @@ scoped_ptr<MoveLoop> MoveLoop::Create(mus::Window* target,
DCHECK_EQ(event.action, mus::mojom::EVENT_TYPE_POINTER_DOWN);
const gfx::Point location(EventLocationToPoint(event));
if (!gfx::Rect(target->bounds().size()).Contains(location) ||
- target->client_area().Contains(location)) {
+ ClientAreaBounds(target).Contains(location)) {
return nullptr;
}
@@ -123,16 +129,17 @@ void MoveLoop::DetermineType(mus::Window* target,
kResizeSize *
std::max(1.f, target->viewport_metrics().device_pixel_ratio));
- if (location.x() < target->client_area().x())
+ const gfx::Rect client_area(ClientAreaBounds(target));
+ if (location.x() < client_area.x())
*h_loc = HorizontalLocation::LEFT;
- else if (location.x() >= target->client_area().right())
+ else if (location.x() >= client_area.right())
*h_loc = HorizontalLocation::RIGHT;
else
*h_loc = HorizontalLocation::OTHER;
if (location.y() < resize_size)
*v_loc = VerticalLocation::TOP;
- else if (location.y() >= target->client_area().bottom())
+ else if (location.y() >= client_area.bottom())
*v_loc = VerticalLocation::BOTTOM;
else
*v_loc = VerticalLocation::OTHER;
« no previous file with comments | « components/mus/example/wm/BUILD.gn ('k') | components/mus/example/wm/move_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698