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

Unified Diff: chrome/browser/ui/cocoa/styled_text_field_cell.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/styled_text_field_cell.mm
===================================================================
--- chrome/browser/ui/cocoa/styled_text_field_cell.mm (revision 84308)
+++ chrome/browser/ui/cocoa/styled_text_field_cell.mm (working copy)
@@ -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 @@
[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 @@
// 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);
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/instant_opt_in_view.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698