| 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 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/sdk_forward_declarations.h" | 9 #include "base/mac/sdk_forward_declarations.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 // translate up from 28 by one line width. | 860 // translate up from 28 by one line width. |
| 861 NSAffineTransform* translationTransform = [NSAffineTransform transform]; | 861 NSAffineTransform* translationTransform = [NSAffineTransform transform]; |
| 862 [translationTransform translateXBy:0 yBy:-1 + lineWidth / 2.]; | 862 [translationTransform translateXBy:0 yBy:-1 + lineWidth / 2.]; |
| 863 [bezierPath transformUsingAffineTransform:translationTransform]; | 863 [bezierPath transformUsingAffineTransform:translationTransform]; |
| 864 | 864 |
| 865 return bezierPath; | 865 return bezierPath; |
| 866 } | 866 } |
| 867 | 867 |
| 868 + (void)setTabEdgeStrokeColor { | 868 + (void)setTabEdgeStrokeColor { |
| 869 static NSColor* strokeColor = | 869 static NSColor* strokeColor = |
| 870 [skia::SkColorToCalibratedNSColor(SkColorSetARGB(76, 0, 0, 0)) retain]; | 870 [skia::SkColorToSRGBNSColor(SkColorSetARGB(76, 0, 0, 0)) retain]; |
| 871 [strokeColor set]; | 871 [strokeColor set]; |
| 872 } | 872 } |
| 873 | 873 |
| 874 + (void)drawTabLeftEdgeImage { | 874 + (void)drawTabLeftEdgeImage { |
| 875 CGContextRef context = static_cast<CGContextRef>( | 875 CGContextRef context = static_cast<CGContextRef>( |
| 876 [[NSGraphicsContext currentContext] graphicsPort]); | 876 [[NSGraphicsContext currentContext] graphicsPort]); |
| 877 | 877 |
| 878 [TabView setTabEdgeStrokeColor]; | 878 [TabView setTabEdgeStrokeColor]; |
| 879 [[self tabLeftEdgeBezierPathForContext:context] stroke]; | 879 [[self tabLeftEdgeBezierPathForContext:context] stroke]; |
| 880 } | 880 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 NSAffineTransform* transform = [NSAffineTransform transform]; | 946 NSAffineTransform* transform = [NSAffineTransform transform]; |
| 947 [transform scaleXBy:-1 yBy:1]; | 947 [transform scaleXBy:-1 yBy:1]; |
| 948 [transform translateXBy:-17.5 yBy:-0.25]; | 948 [transform translateXBy:-17.5 yBy:-0.25]; |
| 949 [bezierPath transformUsingAffineTransform:transform]; | 949 [bezierPath transformUsingAffineTransform:transform]; |
| 950 | 950 |
| 951 [[NSColor whiteColor] set]; | 951 [[NSColor whiteColor] set]; |
| 952 [bezierPath fill]; | 952 [bezierPath fill]; |
| 953 } | 953 } |
| 954 | 954 |
| 955 @end // @implementation TabView(MaterialDesign) | 955 @end // @implementation TabView(MaterialDesign) |
| OLD | NEW |