OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "public/platform/WebScrollbarThemeGeometry.h" | 31 #include "public/platform/WebScrollbarThemeGeometry.h" |
32 #include "wtf/PassOwnPtr.h" | 32 #include "wtf/PassOwnPtr.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class ScrollbarTheme; | 36 class ScrollbarTheme; |
37 class WebScrollbar; | 37 class WebScrollbar; |
38 | 38 |
39 class PLATFORM_EXPORT WebScrollbarThemeGeometryNative : public WebScrollbarTheme
Geometry { | 39 class PLATFORM_EXPORT WebScrollbarThemeGeometryNative : public WebScrollbarTheme
Geometry { |
40 public: | 40 public: |
41 static PassOwnPtr<WebScrollbarThemeGeometryNative> create(ScrollbarTheme*); | 41 static PassOwnPtr<WebScrollbarThemeGeometryNative> create(ScrollbarTheme&); |
42 | 42 |
43 // WebScrollbarThemeGeometry overrides | 43 // WebScrollbarThemeGeometry overrides |
44 WebScrollbarThemeGeometryNative* clone() const override; | 44 WebScrollbarThemeGeometryNative* clone() const override; |
45 int thumbPosition(WebScrollbar*) override; | 45 int thumbPosition(WebScrollbar*) override; |
46 int thumbLength(WebScrollbar*) override; | 46 int thumbLength(WebScrollbar*) override; |
47 int trackPosition(WebScrollbar*) override; | 47 int trackPosition(WebScrollbar*) override; |
48 int trackLength(WebScrollbar*) override; | 48 int trackLength(WebScrollbar*) override; |
49 bool hasButtons(WebScrollbar*) override; | 49 bool hasButtons(WebScrollbar*) override; |
50 bool hasThumb(WebScrollbar*) override; | 50 bool hasThumb(WebScrollbar*) override; |
51 WebRect trackRect(WebScrollbar*) override; | 51 WebRect trackRect(WebScrollbar*) override; |
52 WebRect thumbRect(WebScrollbar*) override; | 52 WebRect thumbRect(WebScrollbar*) override; |
53 int minimumThumbLength(WebScrollbar*) override; | 53 int minimumThumbLength(WebScrollbar*) override; |
54 int scrollbarThickness(WebScrollbar*) override; | 54 int scrollbarThickness(WebScrollbar*) override; |
55 WebRect backButtonStartRect(WebScrollbar*) override; | 55 WebRect backButtonStartRect(WebScrollbar*) override; |
56 WebRect backButtonEndRect(WebScrollbar*) override; | 56 WebRect backButtonEndRect(WebScrollbar*) override; |
57 WebRect forwardButtonStartRect(WebScrollbar*) override; | 57 WebRect forwardButtonStartRect(WebScrollbar*) override; |
58 WebRect forwardButtonEndRect(WebScrollbar*) override; | 58 WebRect forwardButtonEndRect(WebScrollbar*) override; |
59 WebRect constrainTrackRectToTrackPieces(WebScrollbar*, const WebRect&) overr
ide; | 59 WebRect constrainTrackRectToTrackPieces(WebScrollbar*, const WebRect&) overr
ide; |
60 void splitTrack(WebScrollbar*, const WebRect& track, WebRect& startTrack, We
bRect& thumb, WebRect& endTrack) override; | 60 void splitTrack(WebScrollbar*, const WebRect& track, WebRect& startTrack, We
bRect& thumb, WebRect& endTrack) override; |
61 | 61 |
62 private: | 62 private: |
63 explicit WebScrollbarThemeGeometryNative(ScrollbarTheme*); | 63 explicit WebScrollbarThemeGeometryNative(ScrollbarTheme&); |
64 | 64 |
65 // The theme is not owned by this class. It is assumed that the theme is a | 65 // The theme is not owned by this class. It is assumed that the theme is a |
66 // static pointer and its lifetime is essentially infinite. Only thread-safe | 66 // static pointer and its lifetime is essentially infinite. Only thread-safe |
67 // functions on the theme can be called by this theme. | 67 // functions on the theme can be called by this theme. |
68 ScrollbarTheme* m_theme; | 68 ScrollbarTheme& m_theme; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace blink | 71 } // namespace blink |
72 | 72 |
73 #endif | 73 #endif |
OLD | NEW |