Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.h ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/mac/sdk_forward_declarations.h" 8 #include "base/mac/sdk_forward_declarations.h"
9 #include "chrome/browser/themes/theme_service.h" 9 #include "chrome/browser/themes/theme_service.h"
10 #import "chrome/browser/ui/cocoa/nsview_additions.h" 10 #import "chrome/browser/ui/cocoa/nsview_additions.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 664
665 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 665 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
666 NSImage* leftMask = rb.GetNativeImageNamed(IDR_TAB_ALPHA_LEFT).ToNSImage(); 666 NSImage* leftMask = rb.GetNativeImageNamed(IDR_TAB_ALPHA_LEFT).ToNSImage();
667 NSImage* rightMask = rb.GetNativeImageNamed(IDR_TAB_ALPHA_RIGHT).ToNSImage(); 667 NSImage* rightMask = rb.GetNativeImageNamed(IDR_TAB_ALPHA_RIGHT).ToNSImage();
668 668
669 CGFloat leftWidth = leftMask.size.width; 669 CGFloat leftWidth = leftMask.size.width;
670 CGFloat rightWidth = rightMask.size.width; 670 CGFloat rightWidth = rightMask.size.width;
671 671
672 // Image masks must be in the DeviceGray colorspace. Create a context and 672 // Image masks must be in the DeviceGray colorspace. Create a context and
673 // draw the mask into it. 673 // draw the mask into it.
674 base::mac::ScopedCFTypeRef<CGColorSpaceRef> colorspace( 674 base::ScopedCFTypeRef<CGColorSpaceRef> colorspace(
675 CGColorSpaceCreateDeviceGray()); 675 CGColorSpaceCreateDeviceGray());
676 CGContextRef maskContext = 676 CGContextRef maskContext =
677 CGBitmapContextCreate(NULL, tabWidth * scale, kMaskHeight * scale, 677 CGBitmapContextCreate(NULL, tabWidth * scale, kMaskHeight * scale,
678 8, tabWidth * scale, colorspace, 0); 678 8, tabWidth * scale, colorspace, 0);
679 CGContextScaleCTM(maskContext, scale, scale); 679 CGContextScaleCTM(maskContext, scale, scale);
680 NSGraphicsContext* maskGraphicsContext = 680 NSGraphicsContext* maskGraphicsContext =
681 [NSGraphicsContext graphicsContextWithGraphicsPort:maskContext 681 [NSGraphicsContext graphicsContextWithGraphicsPort:maskContext
682 flipped:NO]; 682 flipped:NO];
683 683
684 gfx::ScopedNSGraphicsContextSaveGState scopedGState; 684 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
(...skipping 10 matching lines...) Expand all
695 CGFloat middleWidth = tabWidth - leftWidth - rightWidth; 695 CGFloat middleWidth = tabWidth - leftWidth - rightWidth;
696 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight); 696 NSRect middleRect = NSMakeRect(leftWidth, 0, middleWidth, kFillHeight);
697 [[NSColor whiteColor] setFill]; 697 [[NSColor whiteColor] setFill];
698 NSRectFill(middleRect); 698 NSRectFill(middleRect);
699 699
700 maskCache_.reset(CGBitmapContextCreateImage(maskContext)); 700 maskCache_.reset(CGBitmapContextCreateImage(maskContext));
701 return maskCache_; 701 return maskCache_;
702 } 702 }
703 703
704 @end // @implementation TabView(Private) 704 @end // @implementation TabView(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.h ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698