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

Side by Side Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 1317143005: [WIP] do something :-) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/text/BidiContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 23 matching lines...) Expand all
34 34
35 #include "platform/HostWindow.h" 35 #include "platform/HostWindow.h"
36 #include "platform/Logging.h" 36 #include "platform/Logging.h"
37 #include "platform/geometry/DoubleRect.h" 37 #include "platform/geometry/DoubleRect.h"
38 #include "platform/geometry/FloatPoint.h" 38 #include "platform/geometry/FloatPoint.h"
39 #include "platform/geometry/LayoutRect.h" 39 #include "platform/geometry/LayoutRect.h"
40 #include "platform/graphics/GraphicsLayer.h" 40 #include "platform/graphics/GraphicsLayer.h"
41 #include "platform/scroll/ProgrammaticScrollAnimator.h" 41 #include "platform/scroll/ProgrammaticScrollAnimator.h"
42 #include "platform/scroll/ScrollbarTheme.h" 42 #include "platform/scroll/ScrollbarTheme.h"
43 #include "wtf/PassOwnPtr.h" 43 #include "wtf/PassOwnPtr.h"
44 #include "wtf/SizeAssertions.h"
44 45
45 #include "platform/TraceEvent.h" 46 #include "platform/TraceEvent.h"
46 47
47 static const int kPixelsPerLineStep = 40; 48 static const int kPixelsPerLineStep = 40;
48 static const float kMinFractionToStepWhenPaging = 0.875f; 49 static const float kMinFractionToStepWhenPaging = 0.875f;
49 50
50 namespace blink { 51 namespace blink {
51 52
52 struct SameSizeAsScrollableArea { 53 ASSERT_SIZE(ScrollableArea, 52, 64);
53 virtual ~SameSizeAsScrollableArea();
54 IntRect scrollbarDamage[2];
55 #if ENABLE(ASSERT) && ENABLE(OILPAN)
56 VerifyEagerFinalization verifyEager;
57 #endif
58 void* pointer;
59 unsigned bitfields : 16;
60 IntPoint origin;
61 };
62
63 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol lableArea should stay small");
64 54
65 int ScrollableArea::pixelsPerLineStep() 55 int ScrollableArea::pixelsPerLineStep()
66 { 56 {
67 return kPixelsPerLineStep; 57 return kPixelsPerLineStep;
68 } 58 }
69 59
70 float ScrollableArea::minFractionToStepWhenPaging() 60 float ScrollableArea::minFractionToStepWhenPaging()
71 { 61 {
72 return kMinFractionToStepWhenPaging; 62 return kMinFractionToStepWhenPaging;
73 } 63 }
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; 590 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0;
601 if (Scrollbar* horizontalBar = horizontalScrollbar()) 591 if (Scrollbar* horizontalBar = horizontalScrollbar())
602 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; 592 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0;
603 593
604 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), 594 return IntSize(std::max(0, size.width() - verticalScrollbarWidth),
605 std::max(0, size.height() - horizontalScrollbarHeight)); 595 std::max(0, size.height() - horizontalScrollbarHeight));
606 596
607 } 597 }
608 598
609 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/text/BidiContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698