Index: chrome/browser/ui/cocoa/find_bar/find_bar_view.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/find_bar/find_bar_view.mm (revision 84308) |
+++ chrome/browser/ui/cocoa/find_bar/find_bar_view.mm (working copy) |
@@ -8,6 +8,7 @@ |
#import "chrome/browser/ui/cocoa/themed_window.h" |
#import "chrome/browser/ui/cocoa/url_drop_target.h" |
#import "chrome/browser/ui/cocoa/view_id_util.h" |
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
namespace { |
CGFloat kCurveSize = 8; |
@@ -61,17 +62,19 @@ |
[path curveToPoint:topRight |
controlPoint1:NSMakePoint(midRight2.x, topLeft.y) |
controlPoint2:NSMakePoint(midRight2.x, topLeft.y)]; |
- NSGraphicsContext* context = [NSGraphicsContext currentContext]; |
- [context saveGraphicsState]; |
- [path addClip]; |
- // Set the pattern phase |
- NSPoint phase = [[self window] themePatternPhase]; |
+ { |
+ NSGraphicsContext* context = [NSGraphicsContext currentContext]; |
+ gfx::ScopedNSGraphicsContextSaveGState scopedGState(context); |
+ [path addClip]; |
- [context setPatternPhase:phase]; |
- [super drawBackground]; |
- [context restoreGraphicsState]; |
+ // Set the pattern phase |
+ NSPoint phase = [[self window] themePatternPhase]; |
+ [context setPatternPhase:phase]; |
+ [super drawBackground]; |
+ } |
+ |
[[self strokeColor] set]; |
[path setLineWidth:lineWidth]; |
[path stroke]; |