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

Unified Diff: ash/wm/frame_painter.cc

Issue 10703069: ash: Touch-optimize the window-resize region for touch-events only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/frame_painter.cc
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc
index 3e74d95b0b9760b30c264bd41ab37b6bc2159ecd..61d66fcd6accb02db46e11422e9b4c59af5dcddf 100644
--- a/ash/wm/frame_painter.cc
+++ b/ash/wm/frame_painter.cc
@@ -15,6 +15,7 @@
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/hit_test.h"
@@ -229,10 +230,14 @@ gfx::Rect FramePainter::GetWindowBoundsForClientBounds(
int FramePainter::NonClientHitTest(views::NonClientFrameView* view,
const gfx::Point& point) {
gfx::Rect expanded_bounds = view->bounds();
- int outside_bounds = ui::GetDisplayLayout() == ui::LAYOUT_TOUCH ?
- kResizeOutsideBoundsSizeTouch :
- kResizeOutsideBoundsSize;
+ int outside_bounds = kResizeOutsideBoundsSize;
+
+ if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH &&
+ aura::Env::GetInstance()->is_touch_down()) {
+ outside_bounds = kResizeOutsideBoundsSizeTouch;
+ }
expanded_bounds.Inset(-outside_bounds, -outside_bounds);
+
if (!expanded_bounds.Contains(point))
return HTNOWHERE;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698