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

Unified Diff: chrome/browser/ui/cocoa/location_bar/content_setting_decoration.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/location_bar/content_setting_decoration.mm
===================================================================
--- chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm (revision 84308)
+++ chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm (working copy)
@@ -23,6 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image.h"
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
namespace {
@@ -338,8 +339,7 @@
gradient_.reset([[NSGradient alloc] initWithColors:color_array]);
}
- NSGraphicsContext* context = [NSGraphicsContext currentContext];
- [context saveGraphicsState];
+ gfx::ScopedNSGraphicsContextSaveGState scopedGState;
NSRectClip(frame);
@@ -368,8 +368,6 @@
NSInsetRect(remainder, kTextMarginPadding, kTextMarginPadding);
// .get() needed to fix compiler warning (confusion with NSImageRep).
[animated_text_.get() drawAtPoint:remainder.origin];
-
- [context restoreGraphicsState];
} else {
// No animation, draw the image as normal.
ImageDecoration::DrawInFrame(frame, control_view);
« no previous file with comments | « chrome/browser/ui/cocoa/gradient_button_cell.mm ('k') | chrome/browser/ui/cocoa/location_bar/instant_opt_in_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698