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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutScrollbarTheme.h

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 18 matching lines...) Expand all
29 #include "platform/scroll/ScrollbarTheme.h" 29 #include "platform/scroll/ScrollbarTheme.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 class PlatformMouseEvent; 33 class PlatformMouseEvent;
34 34
35 class LayoutScrollbarTheme final : public ScrollbarTheme { 35 class LayoutScrollbarTheme final : public ScrollbarTheme {
36 public: 36 public:
37 ~LayoutScrollbarTheme() override { } 37 ~LayoutScrollbarTheme() override { }
38 38
39 int scrollbarThickness(ScrollbarControlSize controlSize) override { return S crollbarTheme::theme()->scrollbarThickness(controlSize); } 39 int scrollbarThickness(ScrollbarControlSize controlSize) override { return S crollbarTheme::theme().scrollbarThickness(controlSize); }
40 40
41 ScrollbarButtonsPlacement buttonsPlacement() const override { return Scrollb arTheme::theme()->buttonsPlacement(); } 41 ScrollbarButtonsPlacement buttonsPlacement() const override { return Scrollb arTheme::theme().buttonsPlacement(); }
42 42
43 void paintScrollCorner(GraphicsContext*, const DisplayItemClient&, const Int Rect& cornerRect) override; 43 void paintScrollCorner(GraphicsContext&, const DisplayItemClient&, const Int Rect& cornerRect) override;
44 44
45 bool shouldCenterOnThumb(const ScrollbarThemeClient* scrollbar, const Platfo rmMouseEvent& event) override { return ScrollbarTheme::theme()->shouldCenterOnTh umb(scrollbar, event); } 45 bool shouldCenterOnThumb(const ScrollbarThemeClient& scrollbar, const Platfo rmMouseEvent& event) override { return ScrollbarTheme::theme().shouldCenterOnThu mb(scrollbar, event); }
46 bool shouldSnapBackToDragOrigin(const ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& event) override { return ScrollbarTheme::theme()->shouldSna pBackToDragOrigin(scrollbar, event); } 46 bool shouldSnapBackToDragOrigin(const ScrollbarThemeClient& scrollbar, const PlatformMouseEvent& event) override { return ScrollbarTheme::theme().shouldSnap BackToDragOrigin(scrollbar, event); }
47 47
48 double initialAutoscrollTimerDelay() override { return ScrollbarTheme::theme ()->initialAutoscrollTimerDelay(); } 48 double initialAutoscrollTimerDelay() override { return ScrollbarTheme::theme ().initialAutoscrollTimerDelay(); }
49 double autoscrollTimerDelay() override { return ScrollbarTheme::theme()->aut oscrollTimerDelay(); } 49 double autoscrollTimerDelay() override { return ScrollbarTheme::theme().auto scrollTimerDelay(); }
50 50
51 void registerScrollbar(ScrollbarThemeClient* scrollbar) override { return Sc rollbarTheme::theme()->registerScrollbar(scrollbar); } 51 void registerScrollbar(ScrollbarThemeClient& scrollbar) override { return Sc rollbarTheme::theme().registerScrollbar(scrollbar); }
52 void unregisterScrollbar(ScrollbarThemeClient* scrollbar) override { return ScrollbarTheme::theme()->unregisterScrollbar(scrollbar); } 52 void unregisterScrollbar(ScrollbarThemeClient& scrollbar) override { return ScrollbarTheme::theme().unregisterScrollbar(scrollbar); }
53 53
54 int minimumThumbLength(const ScrollbarThemeClient*) override; 54 int minimumThumbLength(const ScrollbarThemeClient&) override;
55 55
56 void buttonSizesAlongTrackAxis(const ScrollbarThemeClient*, int& beforeSize, int& afterSize); 56 void buttonSizesAlongTrackAxis(const ScrollbarThemeClient&, int& beforeSize, int& afterSize);
57 57
58 static LayoutScrollbarTheme* layoutScrollbarTheme(); 58 static LayoutScrollbarTheme* layoutScrollbarTheme();
59 59
60 protected: 60 protected:
61 bool hasButtons(const ScrollbarThemeClient*) override; 61 bool hasButtons(const ScrollbarThemeClient&) override;
62 bool hasThumb(const ScrollbarThemeClient*) override; 62 bool hasThumb(const ScrollbarThemeClient&) override;
63 63
64 IntRect backButtonRect(const ScrollbarThemeClient*, ScrollbarPart, bool pain ting = false) override; 64 IntRect backButtonRect(const ScrollbarThemeClient&, ScrollbarPart, bool pain ting = false) override;
65 IntRect forwardButtonRect(const ScrollbarThemeClient*, ScrollbarPart, bool p ainting = false) override; 65 IntRect forwardButtonRect(const ScrollbarThemeClient&, ScrollbarPart, bool p ainting = false) override;
66 IntRect trackRect(const ScrollbarThemeClient*, bool painting = false) overri de; 66 IntRect trackRect(const ScrollbarThemeClient&, bool painting = false) overri de;
67 67
68 void paintScrollbarBackground(GraphicsContext*, const ScrollbarThemeClient*) override; 68 void paintScrollbarBackground(GraphicsContext&, const ScrollbarThemeClient&) override;
69 void paintTrackBackground(GraphicsContext*, const ScrollbarThemeClient*, con st IntRect&) override; 69 void paintTrackBackground(GraphicsContext&, const ScrollbarThemeClient&, con st IntRect&) override;
70 void paintTrackPiece(GraphicsContext*, const ScrollbarThemeClient*, const In tRect&, ScrollbarPart) override; 70 void paintTrackPiece(GraphicsContext&, const ScrollbarThemeClient&, const In tRect&, ScrollbarPart) override;
71 void paintButton(GraphicsContext*, const ScrollbarThemeClient*, const IntRec t&, ScrollbarPart) override; 71 void paintButton(GraphicsContext&, const ScrollbarThemeClient&, const IntRec t&, ScrollbarPart) override;
72 void paintThumb(GraphicsContext*, const ScrollbarThemeClient*, const IntRect &) override; 72 void paintThumb(GraphicsContext&, const ScrollbarThemeClient&, const IntRect &) override;
73 void paintTickmarks(GraphicsContext*, const ScrollbarThemeClient*, const Int Rect&) override; 73 void paintTickmarks(GraphicsContext&, const ScrollbarThemeClient&, const Int Rect&) override;
74 74
75 IntRect constrainTrackRectToTrackPieces(const ScrollbarThemeClient*, const I ntRect&) override; 75 IntRect constrainTrackRectToTrackPieces(const ScrollbarThemeClient&, const I ntRect&) override;
76 }; 76 };
77 77
78 } // namespace blink 78 } // namespace blink
79 79
80 #endif // LayoutScrollbarTheme_h 80 #endif // LayoutScrollbarTheme_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698