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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_section_view.mm

Issue 1508893003: Use proper namespace in skia/ext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h"
6 6
7 #import "chrome/browser/ui/chrome_style.h" 7 #import "chrome/browser/ui/chrome_style.h"
8 #include "skia/ext/skia_utils_mac.h" 8 #include "skia/ext/skia_utils_mac.h"
9 9
10 namespace { 10 namespace {
(...skipping 26 matching lines...) Expand all
37 37
38 - (void)drawRect:(NSRect)dirtyRect { 38 - (void)drawRect:(NSRect)dirtyRect {
39 if (shouldHighlightOnHover_ && isHighlighted_) { 39 if (shouldHighlightOnHover_ && isHighlighted_) {
40 [[self hoverColor] set]; 40 [[self hoverColor] set];
41 NSRectFill([self bounds]); 41 NSRectFill([self bounds]);
42 } 42 }
43 } 43 }
44 44
45 - (NSColor*)hoverColor { 45 - (NSColor*)hoverColor {
46 // Shading color is specified as a alpha component color, so premultiply. 46 // Shading color is specified as a alpha component color, so premultiply.
47 NSColor* shadingColor = gfx::SkColorToCalibratedNSColor(kShadingColor); 47 NSColor* shadingColor = skia::SkColorToCalibratedNSColor(kShadingColor);
48 NSColor* blendedColor = [[[self window] backgroundColor] 48 NSColor* blendedColor = [[[self window] backgroundColor]
49 blendedColorWithFraction:[shadingColor alphaComponent] 49 blendedColorWithFraction:[shadingColor alphaComponent]
50 ofColor:shadingColor]; 50 ofColor:shadingColor];
51 return [blendedColor colorWithAlphaComponent:1.0]; 51 return [blendedColor colorWithAlphaComponent:1.0];
52 } 52 }
53 53
54 - (void)setShouldHighlightOnHover:(BOOL)shouldHighlight { 54 - (void)setShouldHighlightOnHover:(BOOL)shouldHighlight {
55 if (shouldHighlight == shouldHighlightOnHover_) 55 if (shouldHighlight == shouldHighlightOnHover_)
56 return; 56 return;
57 shouldHighlightOnHover_ = shouldHighlight; 57 shouldHighlightOnHover_ = shouldHighlight;
58 [self setNeedsDisplay:YES]; 58 [self setNeedsDisplay:YES];
59 } 59 }
60 60
61 - (void)setIsHighlighted:(BOOL)isHighlighted { 61 - (void)setIsHighlighted:(BOOL)isHighlighted {
62 isHighlighted_ = isHighlighted; 62 isHighlighted_ = isHighlighted;
63 if (shouldHighlightOnHover_) 63 if (shouldHighlightOnHover_)
64 [self setNeedsDisplay:YES]; 64 [self setNeedsDisplay:YES];
65 } 65 }
66 66
67 @end 67 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698