| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/renderer/test_runner/WebTestThemeEngineMac.h" | 5 #include "content/shell/renderer/test_runner/WebTestThemeEngineMac.h" |
| 6 | 6 |
| 7 #import <AppKit/NSAffineTransform.h> | 7 #import <AppKit/NSAffineTransform.h> |
| 8 #import <AppKit/NSGraphicsContext.h> | 8 #import <AppKit/NSGraphicsContext.h> |
| 9 #import <AppKit/NSScroller.h> | 9 #import <AppKit/NSScroller.h> |
| 10 #import <AppKit/NSWindow.h> | 10 #import <AppKit/NSWindow.h> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return self; | 60 return self; |
| 61 } | 61 } |
| 62 | 62 |
| 63 - (BOOL)_hasActiveControls | 63 - (BOOL)_hasActiveControls |
| 64 { | 64 { |
| 65 return hasActiveControls; | 65 return hasActiveControls; |
| 66 } | 66 } |
| 67 | 67 |
| 68 @end | 68 @end |
| 69 | 69 |
| 70 namespace WebTestRunner { | 70 namespace content { |
| 71 | 71 |
| 72 namespace { | 72 namespace { |
| 73 | 73 |
| 74 ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) | 74 ThemeTrackEnableState stateToHIEnableState(WebThemeEngine::State state) |
| 75 { | 75 { |
| 76 switch (state) { | 76 switch (state) { |
| 77 case WebThemeEngine::StateDisabled: | 77 case WebThemeEngine::StateDisabled: |
| 78 return kThemeTrackDisabled; | 78 return kThemeTrackDisabled; |
| 79 case WebThemeEngine::StateInactive: | 79 case WebThemeEngine::StateInactive: |
| 80 return kThemeTrackInactive; | 80 return kThemeTrackInactive; |
| 81 default: | 81 default: |
| 82 return kThemeTrackActive; | 82 return kThemeTrackActive; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 } | 86 } // namespace |
| 87 | 87 |
| 88 void WebTestThemeEngineMac::paintScrollbarThumb( | 88 void WebTestThemeEngineMac::paintScrollbarThumb( |
| 89 WebCanvas* canvas, | 89 WebCanvas* canvas, |
| 90 WebThemeEngine::State state, | 90 WebThemeEngine::State state, |
| 91 WebThemeEngine::Size size, | 91 WebThemeEngine::Size size, |
| 92 const WebRect& rect, | 92 const WebRect& rect, |
| 93 const WebThemeEngine::ScrollbarInfo& scrollbarInfo) | 93 const WebThemeEngine::ScrollbarInfo& scrollbarInfo) |
| 94 { | 94 { |
| 95 // To match the Mac port, we still use HITheme for inner scrollbars. | 95 // To match the Mac port, we still use HITheme for inner scrollbars. |
| 96 if (scrollbarInfo.parent == WebThemeEngine::ScrollbarParentRenderLayer) | 96 if (scrollbarInfo.parent == WebThemeEngine::ScrollbarParentRenderLayer) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 [transform concat]; | 167 [transform concat]; |
| 168 | 168 |
| 169 [scroller drawKnob]; | 169 [scroller drawKnob]; |
| 170 CGContextRestoreGState(cgContext); | 170 CGContextRestoreGState(cgContext); |
| 171 | 171 |
| 172 [scroller release]; | 172 [scroller release]; |
| 173 | 173 |
| 174 [NSGraphicsContext restoreGraphicsState]; | 174 [NSGraphicsContext restoreGraphicsState]; |
| 175 } | 175 } |
| 176 | 176 |
| 177 } | 177 } // namespace content |
| OLD | NEW |