Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/glue/webthemeengine_impl_mac.h" | 5 #include "webkit/glue/webthemeengine_impl_mac.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 | 8 |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
| 11 | 11 |
| 12 #if WEBKIT_USING_SKIA | |
| 13 #include "skia/ext/platform_canvas.h" | |
| 14 #include "skia/ext/skia_utils_mac.h" | |
| 15 #endif | |
| 16 | |
| 12 using WebKit::WebCanvas; | 17 using WebKit::WebCanvas; |
| 13 using WebKit::WebRect; | 18 using WebKit::WebRect; |
| 14 using WebKit::WebThemeEngine; | 19 using WebKit::WebThemeEngine; |
| 15 | 20 |
| 16 namespace webkit_glue { | 21 namespace webkit_glue { |
| 17 | 22 |
| 18 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) { | 23 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) { |
| 19 switch (state) { | 24 switch (state) { |
| 20 case WebThemeEngine::StateDisabled: | 25 case WebThemeEngine::StateDisabled: |
| 21 return kThemeTrackDisabled; | 26 return kThemeTrackDisabled; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 45 if (scrollbarInfo.orientation == | 50 if (scrollbarInfo.orientation == |
| 46 WebThemeEngine::ScrollbarOrientationHorizontal) { | 51 WebThemeEngine::ScrollbarOrientationHorizontal) { |
| 47 trackInfo.attributes |= kThemeTrackHorizontal; | 52 trackInfo.attributes |= kThemeTrackHorizontal; |
| 48 } | 53 } |
| 49 | 54 |
| 50 trackInfo.enableState = stateToHIEnableState(state); | 55 trackInfo.enableState = stateToHIEnableState(state); |
| 51 | 56 |
| 52 trackInfo.trackInfo.scrollbar.pressState = | 57 trackInfo.trackInfo.scrollbar.pressState = |
| 53 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; | 58 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; |
| 54 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); | 59 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); |
| 55 HIThemeDrawTrack(&trackInfo, 0, canvas, kHIThemeOrientationNormal); | 60 #if WEBKIT_USING_SKIA |
| 61 gfx::SkiaBitLocker bitLocker(canvas); | |
| 62 CGContextRef cgContext = bitLocker.cgContext(); | |
| 63 #else | |
| 64 CGContextRef cgContext = canvas; | |
| 65 #endif | |
|
Nico
2011/04/14 17:04:45
I assume you will end up with these 6 lines in man
_cary
2011/04/14 17:52:32
Outside of this CL and http://codereview.chromium.
Nico
2011/04/14 17:55:25
I'd still prefer to not have them in a zillion pla
| |
| 66 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); | |
| 56 } | 67 } |
| 57 | 68 |
| 58 } // namespace webkit_glue | 69 } // namespace webkit_glue |
| OLD | NEW |