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

Unified Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 753933003: Dismiss the multi window resizer when the user clicks outside of the resizer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@toplevel_consume_press
Patch Set: Created 6 years 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
Index: ash/wm/workspace/multi_window_resize_controller.cc
diff --git a/ash/wm/workspace/multi_window_resize_controller.cc b/ash/wm/workspace/multi_window_resize_controller.cc
index 07853061c57e0a202c2e684db4f75def71f85836..58935b0dcc543aceae5ee46ec25c81c8b6f2e197 100644
--- a/ash/wm/workspace/multi_window_resize_controller.cc
+++ b/ash/wm/workspace/multi_window_resize_controller.cc
@@ -130,7 +130,9 @@ class MultiWindowResizeController::ResizeMouseWatcherHost :
// MouseWatcherHost overrides:
bool Contains(const gfx::Point& point_in_screen,
MouseEventType type) override {
- return host_->IsOverWindows(point_in_screen);
+ return (type == MOUSE_PRESS)
+ ? host_->IsOverResizeWidget(point_in_screen)
+ : host_->IsOverWindows(point_in_screen);
}
private:
@@ -520,9 +522,15 @@ gfx::Rect MultiWindowResizeController::CalculateResizeWidgetBounds(
return gfx::Rect(x, y, pref.width(), pref.height());
}
+bool MultiWindowResizeController::IsOverResizeWidget(
+ const gfx::Point& location_in_screen) const {
+ return resize_widget_->GetWindowBoundsInScreen().Contains(
+ location_in_screen);
+}
+
bool MultiWindowResizeController::IsOverWindows(
const gfx::Point& location_in_screen) const {
- if (resize_widget_->GetWindowBoundsInScreen().Contains(location_in_screen))
+ if (IsOverResizeWidget(location_in_screen))
return true;
if (windows_.direction == TOP_BOTTOM) {

Powered by Google App Engine
This is Rietveld 408576698