| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 bool ScrollbarThemeChromium::invalidateOnMouseEnterExit() | 74 bool ScrollbarThemeChromium::invalidateOnMouseEnterExit() |
| 75 { | 75 { |
| 76 return runningVista(); | 76 return runningVista(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void ScrollbarThemeChromium::paintTrackPiece(GraphicsContext* gc, Scrollbar* scr
ollbar, const IntRect& rect, ScrollbarPart partType) | 79 void ScrollbarThemeChromium::paintTrackPiece(GraphicsContext* gc, Scrollbar* scr
ollbar, const IntRect& rect, ScrollbarPart partType) |
| 80 { | 80 { |
| 81 bool horz = scrollbar->orientation() == HorizontalScrollbar; | 81 bool horz = scrollbar->orientation() == HorizontalScrollbar; |
| 82 | 82 |
| 83 gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); | 83 skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); |
| 84 HDC hdc = canvas->beginPlatformPaint(); | 84 HDC hdc = canvas->beginPlatformPaint(); |
| 85 | 85 |
| 86 RECT paintRect = toRECT(rect); | 86 RECT paintRect = toRECT(rect); |
| 87 | 87 |
| 88 int partId; | 88 int partId; |
| 89 if (partType == BackTrackPart) { | 89 if (partType == BackTrackPart) { |
| 90 partId = horz ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT; | 90 partId = horz ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT; |
| 91 } else { | 91 } else { |
| 92 partId = horz ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; | 92 partId = horz ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; |
| 93 } | 93 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 104 &alignRect, | 104 &alignRect, |
| 105 gc->platformContext()->canvas()); | 105 gc->platformContext()->canvas()); |
| 106 | 106 |
| 107 canvas->endPlatformPaint(); | 107 canvas->endPlatformPaint(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ScrollbarThemeChromium::paintButton(GraphicsContext* gc, Scrollbar* scrollb
ar, const IntRect& rect, ScrollbarPart part) | 110 void ScrollbarThemeChromium::paintButton(GraphicsContext* gc, Scrollbar* scrollb
ar, const IntRect& rect, ScrollbarPart part) |
| 111 { | 111 { |
| 112 bool horz = scrollbar->orientation() == HorizontalScrollbar; | 112 bool horz = scrollbar->orientation() == HorizontalScrollbar; |
| 113 | 113 |
| 114 gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); | 114 skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); |
| 115 HDC hdc = canvas->beginPlatformPaint(); | 115 HDC hdc = canvas->beginPlatformPaint(); |
| 116 | 116 |
| 117 RECT paintRect = toRECT(rect); | 117 RECT paintRect = toRECT(rect); |
| 118 | 118 |
| 119 int partId; | 119 int partId; |
| 120 if (part == BackButtonStartPart || part == ForwardButtonStartPart) { | 120 if (part == BackButtonStartPart || part == ForwardButtonStartPart) { |
| 121 partId = horz ? DFCS_SCROLLLEFT : DFCS_SCROLLUP; | 121 partId = horz ? DFCS_SCROLLLEFT : DFCS_SCROLLUP; |
| 122 } else { | 122 } else { |
| 123 partId = horz ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN; | 123 partId = horz ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN; |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Draw the thumb (the box you drag in the scroll bar to scroll). | 126 // Draw the thumb (the box you drag in the scroll bar to scroll). |
| 127 gfx::NativeTheme::instance()->PaintScrollbarArrow( | 127 gfx::NativeTheme::instance()->PaintScrollbarArrow( |
| 128 hdc, | 128 hdc, |
| 129 getThemeArrowState(scrollbar, part), | 129 getThemeArrowState(scrollbar, part), |
| 130 partId | getClassicThemeState(scrollbar, part), | 130 partId | getClassicThemeState(scrollbar, part), |
| 131 &paintRect); | 131 &paintRect); |
| 132 | 132 |
| 133 canvas->endPlatformPaint(); | 133 canvas->endPlatformPaint(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ScrollbarThemeChromium::paintThumb(GraphicsContext* gc, Scrollbar* scrollba
r, const IntRect& rect) | 136 void ScrollbarThemeChromium::paintThumb(GraphicsContext* gc, Scrollbar* scrollba
r, const IntRect& rect) |
| 137 { | 137 { |
| 138 bool horz = scrollbar->orientation() == HorizontalScrollbar; | 138 bool horz = scrollbar->orientation() == HorizontalScrollbar; |
| 139 | 139 |
| 140 gfx::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); | 140 skia::PlatformCanvasWin* canvas = gc->platformContext()->canvas(); |
| 141 HDC hdc = canvas->beginPlatformPaint(); | 141 HDC hdc = canvas->beginPlatformPaint(); |
| 142 | 142 |
| 143 RECT paintRect = toRECT(rect); | 143 RECT paintRect = toRECT(rect); |
| 144 | 144 |
| 145 // Draw the thumb (the box you drag in the scroll bar to scroll). | 145 // Draw the thumb (the box you drag in the scroll bar to scroll). |
| 146 gfx::NativeTheme::instance()->PaintScrollbarThumb( | 146 gfx::NativeTheme::instance()->PaintScrollbarThumb( |
| 147 hdc, | 147 hdc, |
| 148 horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, | 148 horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, |
| 149 getThemeState(scrollbar, ThumbPart), | 149 getThemeState(scrollbar, ThumbPart), |
| 150 getClassicThemeState(scrollbar, ThumbPart), | 150 getClassicThemeState(scrollbar, ThumbPart), |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 if (!scrollbar->enabled()) | 238 if (!scrollbar->enabled()) |
| 239 return DFCS_INACTIVE; | 239 return DFCS_INACTIVE; |
| 240 if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == For
wardTrackPart) | 240 if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == For
wardTrackPart) |
| 241 return 0; | 241 return 0; |
| 242 if (scrollbar->pressedPart() == NoPart) | 242 if (scrollbar->pressedPart() == NoPart) |
| 243 return DFCS_HOT; | 243 return DFCS_HOT; |
| 244 return (scrollbar->pressedPart() == part) ? (DFCS_PUSHED | DFCS_FLAT) : 0; | 244 return (scrollbar->pressedPart() == part) ? (DFCS_PUSHED | DFCS_FLAT) : 0; |
| 245 } | 245 } |
| 246 | 246 |
| 247 } | 247 } |
| OLD | NEW |