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/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/themes/theme_service.h" | 8 #include "chrome/browser/themes/theme_service.h" |
9 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 9 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
10 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" | 10 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 350 |
351 [glow drawInBezierPath:path relativeCenterPosition:hoverPoint_]; | 351 [glow drawInBezierPath:path relativeCenterPosition:hoverPoint_]; |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 CGContextEndTransparencyLayer(cgContext); | 355 CGContextEndTransparencyLayer(cgContext); |
356 } | 356 } |
357 | 357 |
358 // Draw the top inner highlight within the tab if using the default theme. | 358 // Draw the top inner highlight within the tab if using the default theme. |
359 if (themeProvider && themeProvider->UsingDefaultTheme()) { | 359 if (themeProvider && themeProvider->UsingDefaultTheme()) { |
| 360 [highlightColor setStroke]; |
| 361 scoped_nsobject<NSBezierPath> highlightPath([path copy]); |
| 362 [highlightPath setLineWidth:lineWidth]; |
| 363 |
| 364 if (!selected) |
| 365 NSRectClip(NSOffsetRect(rect, 0, 2 * lineWidth)); |
| 366 |
360 NSAffineTransform* highlightTransform = [NSAffineTransform transform]; | 367 NSAffineTransform* highlightTransform = [NSAffineTransform transform]; |
361 [highlightTransform translateXBy:lineWidth yBy:-lineWidth]; | 368 [highlightTransform translateXBy:lineWidth yBy:-lineWidth]; |
| 369 [highlightPath transformUsingAffineTransform:highlightTransform]; |
| 370 [highlightPath stroke]; |
362 | 371 |
363 scoped_nsobject<NSBezierPath> highlightPath([path copy]); | |
364 [highlightPath transformUsingAffineTransform:highlightTransform]; | |
365 [highlightColor setStroke]; | |
366 [highlightPath setLineWidth:lineWidth]; | |
367 [highlightPath stroke]; | |
368 highlightTransform = [NSAffineTransform transform]; | 372 highlightTransform = [NSAffineTransform transform]; |
369 [highlightTransform translateXBy:-2 * lineWidth yBy:0.0]; | 373 [highlightTransform translateXBy:-2 * lineWidth yBy:0.0]; |
370 [highlightPath transformUsingAffineTransform:highlightTransform]; | 374 [highlightPath transformUsingAffineTransform:highlightTransform]; |
371 [highlightPath stroke]; | 375 [highlightPath stroke]; |
372 } | 376 } |
373 } | 377 } |
374 | 378 |
375 // Draw the top stroke. | 379 // Draw the top stroke. |
376 { | 380 { |
377 gfx::ScopedNSGraphicsContextSaveGState drawBorderState; | 381 gfx::ScopedNSGraphicsContextSaveGState drawBorderState; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 NSMakePoint(NSMinX(rect) + kInsetMultiplier * NSHeight(rect), | 671 NSMakePoint(NSMinX(rect) + kInsetMultiplier * NSHeight(rect), |
668 NSMaxY(rect)); | 672 NSMaxY(rect)); |
669 | 673 |
670 NSBezierPath* path = [NSBezierPath bezierPath]; | 674 NSBezierPath* path = [NSBezierPath bezierPath]; |
671 [path moveToPoint:topLeft]; | 675 [path moveToPoint:topLeft]; |
672 [path lineToPoint:topRight]; | 676 [path lineToPoint:topRight]; |
673 return path; | 677 return path; |
674 } | 678 } |
675 | 679 |
676 @end // @implementation TabView(Private) | 680 @end // @implementation TabView(Private) |
OLD | NEW |