Index: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h |
diff --git a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..32b428cadbfa25d23144c21f3cc2f723359dd82a |
--- /dev/null |
+++ b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_GFX_SCOPED_NS_GRAPHICS_CONTEXT_SAVE_GSTATE_MAC_H_ |
+#define UI_GFX_SCOPED_NS_GRAPHICS_CONTEXT_SAVE_GSTATE_MAC_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/scoped_nsobject.h" |
+ |
+@class NSGraphicsContext; |
+ |
+namespace gfx { |
+ |
+// What this class does should be self-evident and self-documenting. |
+class ScopedNSGraphicsContextSaveGState { |
+ public: |
+ // If |context| is nil, it will use the |+currentContext|. |
+ explicit ScopedNSGraphicsContextSaveGState(NSGraphicsContext* context = nil); |
+ ~ScopedNSGraphicsContextSaveGState(); |
+ |
+ private: |
+ scoped_nsobject<NSGraphicsContext> context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScopedNSGraphicsContextSaveGState); |
+}; |
+ |
+} // namespace gfx |
+ |
+#endif // UI_GFX_SCOPED_NS_GRAPHICS_CONTEXT_SAVE_GSTATE_MAC_H_ |