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

Side by Side Diff: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc

Issue 393723002: Eliminate drag-off-end scroll canceling for Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/webscrollbarbehavior_impl_gtkoraura.h" 5 #include "content/renderer/webscrollbarbehavior_impl_gtkoraura.h"
6 6
7 #include "third_party/WebKit/public/platform/WebPoint.h" 7 #include "third_party/WebKit/public/platform/WebPoint.h"
8 #include "third_party/WebKit/public/platform/WebRect.h" 8 #include "third_party/WebKit/public/platform/WebRect.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 22 matching lines...) Expand all
33 static const int kOffSideMultiplier = 8; 33 static const int kOffSideMultiplier = 8;
34 34
35 // Find the rect within which we shouldn't snap, by expanding the track rect 35 // Find the rect within which we shouldn't snap, by expanding the track rect
36 // in both dimensions. 36 // in both dimensions.
37 gfx::Rect noSnapRect(scrollbarRect); 37 gfx::Rect noSnapRect(scrollbarRect);
38 const int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width(); 38 const int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width();
39 noSnapRect.Inset( 39 noSnapRect.Inset(
40 (isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness, 40 (isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness,
41 (isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness); 41 (isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness);
42 42
43 // We should snap iff the event is outside our calculated rect. 43 // On most platforms, we should snap iff the event is outside our calculated
44 // rect. On Linux, however, we should not snap for events off the ends, but
45 // not the sides, of the rect.
46 #if (defined(OS_LINUX) && !defined(OS_CHROMEOS))
47 return isHorizontal ?
48 (eventPoint.y < noSnapRect.y() || eventPoint.y >= noSnapRect.bottom()) :
49 (eventPoint.x < noSnapRect.x() || eventPoint.x >= noSnapRect.right());
50 #else
44 return !noSnapRect.Contains(eventPoint); 51 return !noSnapRect.Contains(eventPoint);
52 #endif
45 } 53 }
46 54
47 } // namespace content 55 } // namespace content
OLDNEW
« 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