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

Unified Diff: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h

Issue 7541043: Revert 95611 - Always call the class methods to save/restore contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/gfx/scoped_ns_graphics_context_save_gstate_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
===================================================================
--- ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h (revision 95630)
+++ ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h (working copy)
@@ -4,27 +4,23 @@
#ifndef UI_GFX_SCOPED_NS_GRAPHICS_CONTEXT_SAVE_GSTATE_MAC_H_
#define UI_GFX_SCOPED_NS_GRAPHICS_CONTEXT_SAVE_GSTATE_MAC_H_
-#pragma once
-#include "base/basictypes.h"
#include "ui/ui_api.h"
+#include "base/basictypes.h"
+#include "base/memory/scoped_nsobject.h"
-#if defined(__OBJC__)
@class NSGraphicsContext;
-#else
-class NSGraphicsContext;
-#endif
namespace gfx {
-// A class to save/restore the state of the current context.
class UI_API ScopedNSGraphicsContextSaveGState {
public:
- ScopedNSGraphicsContextSaveGState();
+ // If |context| is nil, it will use the |+currentContext|.
+ explicit ScopedNSGraphicsContextSaveGState(NSGraphicsContext* context = nil);
~ScopedNSGraphicsContextSaveGState();
private:
- NSGraphicsContext* context_; // weak
+ scoped_nsobject<NSGraphicsContext> context_;
DISALLOW_COPY_AND_ASSIGN(ScopedNSGraphicsContextSaveGState);
};
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/gfx/scoped_ns_graphics_context_save_gstate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698