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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm

Issue 2890733002: Make EBorderStyle an enum class. (Closed)
Patch Set: Build for Mac Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 // Use the font size to determine the intrinsic width of the control. 874 // Use the font size to determine the intrinsic width of the control.
875 SetSizeFromFont(style, SearchFieldSizes()); 875 SetSizeFromFont(style, SearchFieldSizes());
876 } 876 }
877 877
878 const int kSearchFieldBorderWidth = 2; 878 const int kSearchFieldBorderWidth = 2;
879 void LayoutThemeMac::AdjustSearchFieldStyle(ComputedStyle& style) const { 879 void LayoutThemeMac::AdjustSearchFieldStyle(ComputedStyle& style) const {
880 // Override border. 880 // Override border.
881 style.ResetBorder(); 881 style.ResetBorder();
882 const short border_width = kSearchFieldBorderWidth * style.EffectiveZoom(); 882 const short border_width = kSearchFieldBorderWidth * style.EffectiveZoom();
883 style.SetBorderLeftWidth(border_width); 883 style.SetBorderLeftWidth(border_width);
884 style.SetBorderLeftStyle(kBorderStyleInset); 884 style.SetBorderLeftStyle(EBorderStyle::kInset);
885 style.SetBorderRightWidth(border_width); 885 style.SetBorderRightWidth(border_width);
886 style.SetBorderRightStyle(kBorderStyleInset); 886 style.SetBorderRightStyle(EBorderStyle::kInset);
887 style.SetBorderBottomWidth(border_width); 887 style.SetBorderBottomWidth(border_width);
888 style.SetBorderBottomStyle(kBorderStyleInset); 888 style.SetBorderBottomStyle(EBorderStyle::kInset);
889 style.SetBorderTopWidth(border_width); 889 style.SetBorderTopWidth(border_width);
890 style.SetBorderTopStyle(kBorderStyleInset); 890 style.SetBorderTopStyle(EBorderStyle::kInset);
891 891
892 // Override height. 892 // Override height.
893 style.SetHeight(Length(kAuto)); 893 style.SetHeight(Length(kAuto));
894 SetSearchFieldSize(style); 894 SetSearchFieldSize(style);
895 895
896 NSControlSize control_size = ControlSizeForFont(style); 896 NSControlSize control_size = ControlSizeForFont(style);
897 897
898 // Override padding size to match AppKit text positioning. 898 // Override padding size to match AppKit text positioning.
899 const int vertical_padding = 1 * style.EffectiveZoom(); 899 const int vertical_padding = 1 * style.EffectiveZoom();
900 const int horizontal_padding = 900 const int horizontal_padding =
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 } 1115 }
1116 1116
1117 bool LayoutThemeMac::ShouldUseFallbackTheme(const ComputedStyle& style) const { 1117 bool LayoutThemeMac::ShouldUseFallbackTheme(const ComputedStyle& style) const {
1118 ControlPart part = style.Appearance(); 1118 ControlPart part = style.Appearance();
1119 if (part == kCheckboxPart || part == kRadioPart) 1119 if (part == kCheckboxPart || part == kRadioPart)
1120 return style.EffectiveZoom() != 1; 1120 return style.EffectiveZoom() != 1;
1121 return false; 1121 return false;
1122 } 1122 }
1123 1123
1124 } // namespace blink 1124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698