Index: chrome/browser/ui/cocoa/styled_text_field_cell.mm |
diff --git a/chrome/browser/ui/cocoa/styled_text_field_cell.mm b/chrome/browser/ui/cocoa/styled_text_field_cell.mm |
index 387d24302c703af2f90c5e8fe03b851c2e5d9b95..308362bbb7d0a6f4336f999c78e11100717c0e06 100644 |
--- a/chrome/browser/ui/cocoa/styled_text_field_cell.mm |
+++ b/chrome/browser/ui/cocoa/styled_text_field_cell.mm |
@@ -12,6 +12,7 @@ |
#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/gfx/font.h" |
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
namespace { |
@@ -68,25 +69,6 @@ void FrameRectWithInset(StyledTextFieldCellRoundedFlags roundedFlags, |
[path stroke]; |
} |
-// TODO(shess): Maybe we need a |cocoa_util.h|? |
-class ScopedSaveGraphicsState { |
- public: |
- ScopedSaveGraphicsState() |
- : context_([NSGraphicsContext currentContext]) { |
- [context_ saveGraphicsState]; |
- } |
- explicit ScopedSaveGraphicsState(NSGraphicsContext* context) |
- : context_(context) { |
- [context_ saveGraphicsState]; |
- } |
- ~ScopedSaveGraphicsState() { |
- [context_ restoreGraphicsState]; |
- } |
- |
-private: |
- NSGraphicsContext* context_; |
-}; |
- |
} // namespace |
@implementation StyledTextFieldCell |
@@ -189,7 +171,7 @@ private: |
// outer border line on the bottom and right. The clipping change |
// will clip the bottom and right edges (and corner). |
{ |
- ScopedSaveGraphicsState state; |
+ gfx::ScopedNSGraphicsContextSaveGState state; |
[RectPathWithInset(roundedFlags, frame, lineWidth, radius) addClip]; |
const NSRect shadowFrame = |
NSOffsetRect(frame, halfLineWidth, halfLineWidth); |