OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/webthemeengine_impl_mac.h" | 5 #include "webkit/child/webthemeengine_impl_mac.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include "skia/ext/skia_utils_mac.h" | 9 #include "skia/ext/skia_utils_mac.h" |
10 #include "third_party/WebKit/public/platform/WebCanvas.h" | 10 #include "third_party/WebKit/public/platform/WebCanvas.h" |
11 #include "third_party/WebKit/public/platform/WebRect.h" | 11 #include "third_party/WebKit/public/platform/WebRect.h" |
12 | 12 |
13 using WebKit::WebCanvas; | 13 using blink::WebCanvas; |
14 using WebKit::WebRect; | 14 using blink::WebRect; |
15 using WebKit::WebThemeEngine; | 15 using blink::WebThemeEngine; |
16 | 16 |
17 namespace webkit_glue { | 17 namespace webkit_glue { |
18 | 18 |
19 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) { | 19 static ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) { |
20 switch (state) { | 20 switch (state) { |
21 case WebThemeEngine::StateDisabled: | 21 case WebThemeEngine::StateDisabled: |
22 return kThemeTrackDisabled; | 22 return kThemeTrackDisabled; |
23 case WebThemeEngine::StateInactive: | 23 case WebThemeEngine::StateInactive: |
24 return kThemeTrackInactive; | 24 return kThemeTrackInactive; |
25 default: | 25 default: |
(...skipping 26 matching lines...) Expand all Loading... |
52 | 52 |
53 trackInfo.trackInfo.scrollbar.pressState = | 53 trackInfo.trackInfo.scrollbar.pressState = |
54 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; | 54 state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0; |
55 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); | 55 trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack); |
56 gfx::SkiaBitLocker bitLocker(canvas); | 56 gfx::SkiaBitLocker bitLocker(canvas); |
57 CGContextRef cgContext = bitLocker.cgContext(); | 57 CGContextRef cgContext = bitLocker.cgContext(); |
58 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); | 58 HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal); |
59 } | 59 } |
60 | 60 |
61 } // namespace webkit_glue | 61 } // namespace webkit_glue |
OLD | NEW |