OLD | NEW |
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 "ui/gfx/native_theme_base.h" | 5 #include "ui/gfx/native_theme_base.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "grit/gfx_resources.h" | 10 #include "grit/gfx_resources.h" |
11 #include "third_party/skia/include/effects/SkGradientShader.h" | 11 #include "third_party/skia/include/effects/SkGradientShader.h" |
12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 | 18 |
19 unsigned int NativeThemeBase::button_length_ = 14; | 19 unsigned int NativeThemeBase::button_length_ = 14; |
20 #if defined(TOUCH_UI) | |
21 unsigned int NativeThemeBase::scrollbar_width_ = 0; | |
22 #else | |
23 unsigned int NativeThemeBase::scrollbar_width_ = 15; | 20 unsigned int NativeThemeBase::scrollbar_width_ = 15; |
24 #endif | |
25 | 21 |
26 // These are the default dimensions of radio buttons and checkboxes. | 22 // These are the default dimensions of radio buttons and checkboxes. |
27 static const int kCheckboxAndRadioWidth = 13; | 23 static const int kCheckboxAndRadioWidth = 13; |
28 static const int kCheckboxAndRadioHeight = 13; | 24 static const int kCheckboxAndRadioHeight = 13; |
29 | 25 |
30 // These sizes match the sizes in Chromium Win. | 26 // These sizes match the sizes in Chromium Win. |
31 static const int kSliderThumbWidth = 11; | 27 static const int kSliderThumbWidth = 11; |
32 static const int kSliderThumbHeight = 21; | 28 static const int kSliderThumbHeight = 21; |
33 | 29 |
34 static const SkColor kSliderTrackBackgroundColor = | 30 static const SkColor kSliderTrackBackgroundColor = |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); | 981 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); |
986 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); | 982 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); |
987 | 983 |
988 if (hsv1[2] + hsv2[2] > 1.0) | 984 if (hsv1[2] + hsv2[2] > 1.0) |
989 diff = -diff; | 985 diff = -diff; |
990 | 986 |
991 return SaturateAndBrighten(hsv2, -0.2f, diff); | 987 return SaturateAndBrighten(hsv2, -0.2f, diff); |
992 } | 988 } |
993 | 989 |
994 } // namespace gfx | 990 } // namespace gfx |
OLD | NEW |