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

Unified Diff: chrome/browser/ui/cocoa/find_bar/find_bar_view.mm

Issue 6927058: Merge 83125 - Add and use gfx::ScopedNSGraphicsContextState (ui/gfx/scoped_ns_graphics_context_st... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
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];
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/browser_action_button.mm ('k') | chrome/browser/ui/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698