Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 | 198 |
| 199 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; | 199 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; |
| 200 if (scrollbar.orientation() == VerticalScrollbar) | 200 if (scrollbar.orientation() == VerticalScrollbar) |
| 201 part = WebThemeEngine::PartScrollbarVerticalThumb; | 201 part = WebThemeEngine::PartScrollbarVerticalThumb; |
| 202 | 202 |
| 203 blink::WebThemeEngine::ExtraParams params; | 203 blink::WebThemeEngine::ExtraParams params; |
| 204 params.scrollbarThumb.scrollbarTheme = | 204 params.scrollbarThumb.scrollbarTheme = |
| 205 static_cast<WebScrollbarOverlayColorTheme>( | 205 static_cast<WebScrollbarOverlayColorTheme>( |
| 206 scrollbar.getScrollbarOverlayColorTheme()); | 206 scrollbar.getScrollbarOverlayColorTheme()); |
| 207 | 207 |
| 208 // Filp the canvas if it is left vertical scrollbar. | |
|
Evan Stade
2017/03/29 18:05:42
nit: s/Filp/Horizontally flip/
| |
| 209 if (scrollbar.isLeftSideVerticalScrollbar()) { | |
| 210 canvas->save(); | |
| 211 canvas->translate(canvas->getBaseLayerSize().width(), 0); | |
| 212 canvas->scale(-1, 1); | |
| 213 } | |
| 214 | |
| 208 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), | 215 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), |
| 209 ¶ms); | 216 ¶ms); |
| 217 | |
| 218 if (scrollbar.isLeftSideVerticalScrollbar()) | |
| 219 canvas->restore(); | |
| 210 } | 220 } |
| 211 | 221 |
| 212 ScrollbarPart ScrollbarThemeOverlay::hitTest( | 222 ScrollbarPart ScrollbarThemeOverlay::hitTest( |
| 213 const ScrollbarThemeClient& scrollbar, | 223 const ScrollbarThemeClient& scrollbar, |
| 214 const IntPoint& position) { | 224 const IntPoint& position) { |
| 215 if (m_allowHitTest == DisallowHitTest) | 225 if (m_allowHitTest == DisallowHitTest) |
| 216 return NoPart; | 226 return NoPart; |
| 217 | 227 |
| 218 ScrollbarPart part = ScrollbarTheme::hitTest(scrollbar, position); | 228 ScrollbarPart part = ScrollbarTheme::hitTest(scrollbar, position); |
| 219 if (part != ThumbPart) | 229 if (part != ThumbPart) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 | 274 |
| 265 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; | 275 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; |
| 266 if (scrollbar.orientation() == VerticalScrollbar) | 276 if (scrollbar.orientation() == VerticalScrollbar) |
| 267 part = WebThemeEngine::PartScrollbarVerticalThumb; | 277 part = WebThemeEngine::PartScrollbarVerticalThumb; |
| 268 | 278 |
| 269 DCHECK(Platform::current()->themeEngine()); | 279 DCHECK(Platform::current()->themeEngine()); |
| 270 return Platform::current()->themeEngine()->ninePatchAperture(part); | 280 return Platform::current()->themeEngine()->ninePatchAperture(part); |
| 271 } | 281 } |
| 272 | 282 |
| 273 } // namespace blink | 283 } // namespace blink |
| OLD | NEW |