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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_popup_view_mac.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, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" 7 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h"
8 8
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 10 matching lines...) Expand all
21 #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.h" 21 #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.h"
22 #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_view.h" 22 #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_view.h"
23 #import "chrome/browser/ui/cocoa/location_bar/omnibox_popup_view.h" 23 #import "chrome/browser/ui/cocoa/location_bar/omnibox_popup_view.h"
24 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
25 #include "skia/ext/skia_utils_mac.h" 25 #include "skia/ext/skia_utils_mac.h"
26 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 26 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
27 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" 27 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
28 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
29 #include "ui/base/text/text_elider.h" 29 #include "ui/base/text/text_elider.h"
30 #include "ui/gfx/rect.h" 30 #include "ui/gfx/rect.h"
31 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
31 32
32 namespace { 33 namespace {
33 34
34 // The size delta between the font used for the edit and the result 35 // The size delta between the font used for the edit and the result
35 // rows. 36 // rows.
36 const int kEditFontAdjust = -1; 37 const int kEditFontAdjust = -1;
37 38
38 // How much to adjust the cell sizing up from the default determined 39 // How much to adjust the cell sizing up from the default determined
39 // by the font. 40 // by the font.
40 const int kCellHeightAdjust = 6.0; 41 const int kCellHeightAdjust = 6.0;
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 817
817 // "Top" really means "bottom" here, since the view is flipped. 818 // "Top" really means "bottom" here, since the view is flipped.
818 NSBezierPath* path = 819 NSBezierPath* path =
819 [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds] 820 [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds]
820 topLeftCornerRadius:bottomCornerRadius 821 topLeftCornerRadius:bottomCornerRadius
821 topRightCornerRadius:bottomCornerRadius 822 topRightCornerRadius:bottomCornerRadius
822 bottomLeftCornerRadius:kPopupRoundingRadius 823 bottomLeftCornerRadius:kPopupRoundingRadius
823 bottomRightCornerRadius:kPopupRoundingRadius]; 824 bottomRightCornerRadius:kPopupRoundingRadius];
824 825
825 // Draw the matrix clipped to our border. 826 // Draw the matrix clipped to our border.
826 [NSGraphicsContext saveGraphicsState]; 827 gfx::ScopedNSGraphicsContextSaveGState scopedGState;
827 [path addClip]; 828 [path addClip];
828 [super drawRect:rect]; 829 [super drawRect:rect];
829 [NSGraphicsContext restoreGraphicsState];
830 } 830 }
831 831
832 @end 832 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698