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

Unified Diff: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h

Issue 7572031: Always call the class methods to save/restore contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reword 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
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
index 05bf5f660f38e9a58ba5d3b324a52e4db437a13e..4826bcc2cb98e6743f8f64d5e4cf5b1f031a9fed 100644
--- a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
+++ b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
@@ -4,23 +4,27 @@
#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 "ui/ui_api.h"
#include "base/basictypes.h"
-#include "base/memory/scoped_nsobject.h"
+#include "ui/ui_api.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:
- // If |context| is nil, it will use the |+currentContext|.
- explicit ScopedNSGraphicsContextSaveGState(NSGraphicsContext* context = nil);
+ ScopedNSGraphicsContextSaveGState();
~ScopedNSGraphicsContextSaveGState();
private:
- scoped_nsobject<NSGraphicsContext> context_;
+ NSGraphicsContext* context_; // weak
DISALLOW_COPY_AND_ASSIGN(ScopedNSGraphicsContextSaveGState);
};

Powered by Google App Engine
This is Rietveld 408576698